mirror of https://github.com/ARMmbed/mbed-os.git
Serial implementation uses different vector handlers for sync/async calls respectively. The issue can be reproduced with the following flow: 1. Register sync mode callback with Serial.attach(). 2. Sync call with Serial.putc()/getc(). 3. Change to async call with Serial.write()/read(). 4. Change back to sync call with Serial.putc()/getc(). Now, vector handller is still for async mode, not for sync mode. To fix it: 1. Introduce internal function serial_enable_interrupt() for both sync/async vector handler enable/disable. Original HAL function serial_irq_set() is reduced to call it for sync mode vector handler enable/disable. 2. Introduce internal function serial_rollback_interrupt() to roll back sync mode vector handler at end of async transfer. |
||
---|---|---|
.. | ||
PeripheralNames.h | ||
PeripheralPins.c | ||
PeripheralPins.h | ||
PinNames.h | ||
PortNames.h | ||
device.h | ||
mbed_overrides.c | ||
objects.h |