Commit Graph
24 Commits
Author SHA1 Message Date
Henry Gabryjelski 7c990c498c Fix compilation warning.
size_t is unsigned; the #defined constant was treated as an integer,
which caused the following warning:

In file included from cores\nRF5\Uart.cpp:21:0:
cores\nRF5\Arduino.h: In instantiation of
```C++
  decltype ( ((b < a) ? b :  a) )
   min(const T&, const L&)
   [with
    T = unsigned int;
    L = int;
    decltype (((b < a) ? b :  a)) = unsigned int
   ]:
```

cores\nRF5\Uart.cpp:228:54: required from here
cores\nRF5\Arduino.h:92:15: warning:
comparison between signed and unsigned integer expressions [-Wsign-compare]
     return (b < a) ? b : a;
2020-02-11 14:33:58 -08:00
hathach a00eb4fa70 remove SERIAL_INTERFACES_COUNT macro
nrf52832 keep PIN_SERIAL_RX/TX
2020-01-31 22:09:46 +07:00
hathach 923974f6c4 support SerialEvent1/2 2020-01-31 21:28:28 +07:00
hathach 306b10dc7f follow up to #315
- Add SERIAL_INTERFACES_COUNT to all variants
- Rename PIN_SERIAL_RX/TX & PIN_SERIAL1_RX/TX
2020-01-31 21:27:54 +07:00
ogatasu b75328779a Fix serial port names macro 2019-08-06 23:06:53 +09:00
ogatasu 4533ddb8e9 Enable Uart config argument 2019-08-04 20:46:27 +09:00
ogatasu e8f90bc644 support Serial2 2019-08-04 16:59:48 +09:00
hathach a11132212f Merge branch 'master' into master 2019-01-10 16:55:22 +07:00
hathach 6ee2212913 add note for Serial2 (not yet implemented) 2018-11-06 16:39:10 +07:00
hathach 49691adb81 remove Serial.started(), make it safe to call Serial.begin() multiple times 2018-10-18 14:38:43 +07:00
hathach 6f8c546595 serial port clean up 2018-09-01 13:40:04 +07:00
hathach 057cba9a93 redirect Serial to USBSerial for nrf52840 2018-08-30 15:40:16 +07:00
hathach 043aa57f43 clean up 2018-08-24 00:31:42 +07:00
hathach 5adabb9c6a Merge branch 'master' into develop 2018-07-12 21:36:36 +07:00
hathach e6c4b0ff7e support serialEvent() 2018-07-12 16:51:28 +07:00
ChristofR 0c0026029f Bug Fix: UART IRQ Freezing
It was found that receiving UART data too rapidly would completely brick the UART peripheral (no further UART IRQs would be generated).

To brick the peripheral all of the following needs to be true.
1. A BLE connection is active
2. Serial speed is set fast enough (>= 115,200)
3. A continuous stream of Serial data needs to be received

Since interrupt timing is no longer guaranteed when the SoftDevice has an active BLE connection it is much more likely for UART data to be received when inside the UART IRQ. Clearing nrfUart->EVENTS_RXDRDY at the end of the IRQ increases the likelyhood of the system setting a pending IRQ before the current IRQ loop has cleared nrfUart->EVENTS_RXDRDY. If this occurs then the UART IRQ will be called again, but nrfUart->EVENTS_RXDRDY will be 0. Since nrfUart->RXD is no longer being cleared overruns start occuring and for some unknown reason the UART IRQ stops trigerring.
2018-06-07 15:51:57 +02:00
ChristofR 47ae6e88fd Bug Fix: UART IRQ Freezing
It was found that receiving UART data too rapidly would completely brick the UART peripheral (no further UART IRQs would be generated).

To brick the peripheral all of the following needs to be true.
1. A BLE connection is active
2. Serial speed is set fast enough (>= 115,200)
3. A continuous stream of Serial data needs to be received

Since interrupt timing is no longer guaranteed when the SoftDevice has an active BLE connection it is much more likely for UART data to be received when inside the UART IRQ. Clearing nrfUart->EVENTS_RXDRDY at the end of the IRQ increases the likelyhood of the system setting a pending IRQ before the current IRQ loop has cleared nrfUart->EVENTS_RXDRDY. If this occurs then the UART IRQ will be called again, but nrfUart->EVENTS_RXDRDY will be 0. Since nrfUart->RXD is no longer being cleared overruns start occuring and for some unknown reason the UART IRQ stops trigerring.
2018-06-07 15:49:54 +02:00
hathach 313705e15c add nrf52 series common macros NRF52_SERIES 2018-04-17 17:20:22 +07:00
Ureloc 92b638100c Implemented Uart::flush() 2017-10-25 14:35:08 +02:00
hathach 2583357eff clean up 2017-07-29 01:30:28 +07:00
hathach 9c99fe9c03 add Uart.setPins() to remap Serial rx, tx 2017-07-28 12:28:22 +07:00
hathach b1336100cc add mutex for uart to prevent write conflict 2017-04-04 12:39:02 +07:00
hathach fe148b78d7 add Uart _begun, fix potetial hard fault with Debug level ON but Serial.begin() is not called 2017-03-17 13:36:26 +07:00
hathach 6151838f8f adding file from sandeepmistry/arduino-nRF5 2016-11-22 01:08:21 +07:00