105
105
/**
106
106
* Missing event typedefs.
107
107
*/
108
- typedef enum
109
- {
108
+ typedef enum {
110
109
NRF_UARTE_EVENT_TXDRDY = offsetof(NRF_UARTE_Type , EVENTS_TXDRDY ),
111
110
} nrf_uarte_event_extra_t ;
112
111
@@ -505,8 +504,7 @@ static void nordic_nrf5_uart_event_handler_endrx_asynch(int instance)
505
504
static void nordic_nrf5_uart_event_handler (int instance )
506
505
{
507
506
/* 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 )) {
510
508
nrf_uarte_event_clear (nordic_nrf5_uart_register [instance ], NRF_UARTE_EVENT_ENDRX );
511
509
512
510
#if DEVICE_SERIAL_ASYNCH
@@ -528,16 +526,14 @@ static void nordic_nrf5_uart_event_handler(int instance)
528
526
* will setup the wrong DMA buffer and cause data to be lost.
529
527
*/
530
528
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 )) {
533
530
nrf_uarte_event_clear (nordic_nrf5_uart_register [instance ], NRF_UARTE_EVENT_RXSTARTED );
534
531
535
532
nordic_nrf5_uart_event_handler_rxstarted (instance );
536
533
}
537
534
538
535
/* 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 )) {
541
537
nrf_uarte_event_clear (nordic_nrf5_uart_register [instance ], NRF_UARTE_EVENT_ENDTX );
542
538
543
539
/* Use SWI to de-prioritize callback. */
@@ -691,7 +687,7 @@ static void nordic_nrf5_uart_configure_rx(int instance)
691
687
{
692
688
/* Disable interrupts during confiration. */
693
689
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 );
695
691
696
692
/* Clear FIFO buffer. */
697
693
nrf_atfifo_clear (nordic_nrf5_uart_state [instance ].fifo );
@@ -720,7 +716,7 @@ static void nordic_nrf5_uart_configure_rx(int instance)
720
716
721
717
/* Enable interrupts again. */
722
718
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 );
724
720
}
725
721
726
722
#if DEVICE_SERIAL_ASYNCH
@@ -733,7 +729,7 @@ static void nordic_nrf5_uart_configure_rx_asynch(int instance)
733
729
{
734
730
/* Disable Rx related interrupts. */
735
731
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 );
737
733
738
734
/* Clear Rx related events. */
739
735
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)
803
799
nrf_uarte_task_trigger (nordic_nrf5_uart_register [instance ],
804
800
NRF_UARTE_TASK_STARTRX );
805
801
806
- /* Owner hasn't changed but mode has. Reconfigure. */
802
+ /* Owner hasn't changed but mode has. Reconfigure. */
807
803
} else if ((uart_object -> rx_asynch == true) && (nordic_nrf5_uart_state [instance ].rx_asynch == false)) {
808
804
809
805
nordic_nrf5_uart_configure_rx_asynch (instance );
@@ -942,8 +938,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx)
942
938
bool done = false;
943
939
do {
944
940
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);
947
943
}
948
944
949
945
/* Store pins in serial object. */
@@ -1370,7 +1366,7 @@ void serial_putc(serial_t *obj, int character)
1370
1366
/* Wait until UART is ready to send next character. */
1371
1367
do {
1372
1368
done = nrf_uarte_event_check (nordic_nrf5_uart_register [instance ], NRF_UARTE_EVENT_TXDRDY );
1373
- } while (done == false);
1369
+ } while (done == false);
1374
1370
1375
1371
nrf_uarte_event_clear (nordic_nrf5_uart_register [instance ], NRF_UARTE_EVENT_TXDRDY );
1376
1372
0 commit comments