Skip to content

Commit 6a9b4bb

Browse files
committed
TARGET_NRF52/serial_api.c: Fix style
1 parent fbe8a8e commit 6a9b4bb

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@
105105
/**
106106
* Missing event typedefs.
107107
*/
108-
typedef enum
109-
{
108+
typedef enum {
110109
NRF_UARTE_EVENT_TXDRDY = offsetof(NRF_UARTE_Type, EVENTS_TXDRDY),
111110
} nrf_uarte_event_extra_t;
112111

@@ -505,8 +504,7 @@ static void nordic_nrf5_uart_event_handler_endrx_asynch(int instance)
505504
static void nordic_nrf5_uart_event_handler(int instance)
506505
{
507506
/* DMA buffer is full or has been swapped out by idle timeout. */
508-
if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDRX))
509-
{
507+
if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDRX)) {
510508
nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDRX);
511509

512510
#if DEVICE_SERIAL_ASYNCH
@@ -528,16 +526,14 @@ static void nordic_nrf5_uart_event_handler(int instance)
528526
* will setup the wrong DMA buffer and cause data to be lost.
529527
*/
530528
if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_RXSTARTED) &&
531-
!nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDRX))
532-
{
529+
!nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDRX)) {
533530
nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_RXSTARTED);
534531

535532
nordic_nrf5_uart_event_handler_rxstarted(instance);
536533
}
537534

538535
/* Tx DMA buffer has been sent. */
539-
if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX))
540-
{
536+
if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX)) {
541537
nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX);
542538

543539
/* Use SWI to de-prioritize callback. */
@@ -691,7 +687,7 @@ static void nordic_nrf5_uart_configure_rx(int instance)
691687
{
692688
/* Disable interrupts during confiration. */
693689
nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK |
694-
NRF_UARTE_INT_ENDRX_MASK);
690+
NRF_UARTE_INT_ENDRX_MASK);
695691

696692
/* Clear FIFO buffer. */
697693
nrf_atfifo_clear(nordic_nrf5_uart_state[instance].fifo);
@@ -720,7 +716,7 @@ static void nordic_nrf5_uart_configure_rx(int instance)
720716

721717
/* Enable interrupts again. */
722718
nrf_uarte_int_enable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK |
723-
NRF_UARTE_INT_ENDRX_MASK);
719+
NRF_UARTE_INT_ENDRX_MASK);
724720
}
725721

726722
#if DEVICE_SERIAL_ASYNCH
@@ -733,7 +729,7 @@ static void nordic_nrf5_uart_configure_rx_asynch(int instance)
733729
{
734730
/* Disable Rx related interrupts. */
735731
nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK |
736-
NRF_UARTE_INT_ENDRX_MASK);
732+
NRF_UARTE_INT_ENDRX_MASK);
737733

738734
/* Clear Rx related events. */
739735
nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_RXSTARTED);
@@ -803,7 +799,7 @@ static void nordic_nrf5_serial_configure(serial_t *obj)
803799
nrf_uarte_task_trigger(nordic_nrf5_uart_register[instance],
804800
NRF_UARTE_TASK_STARTRX);
805801

806-
/* Owner hasn't changed but mode has. Reconfigure. */
802+
/* Owner hasn't changed but mode has. Reconfigure. */
807803
} else if ((uart_object->rx_asynch == true) && (nordic_nrf5_uart_state[instance].rx_asynch == false)) {
808804

809805
nordic_nrf5_uart_configure_rx_asynch(instance);
@@ -942,8 +938,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
942938
bool done = false;
943939
do {
944940
done = nrf_uarte_event_check(nordic_nrf5_uart_register[instance],
945-
(nrf_uarte_event_t) NRF_UARTE_EVENT_TXDRDY);
946-
} while(done == false);
941+
(nrf_uarte_event_t) NRF_UARTE_EVENT_TXDRDY);
942+
} while (done == false);
947943
}
948944

949945
/* Store pins in serial object. */
@@ -1370,7 +1366,7 @@ void serial_putc(serial_t *obj, int character)
13701366
/* Wait until UART is ready to send next character. */
13711367
do {
13721368
done = nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY);
1373-
} while(done == false);
1369+
} while (done == false);
13741370

13751371
nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY);
13761372

0 commit comments

Comments
 (0)