Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Autoflight2018_22_MODSERIAL
Fork of MODSERIAL by
Diff: FLUSH.cpp
- Revision:
- 27:9c93ce7cb9d8
- Parent:
- 2:b936b4acbd92
- Child:
- 28:76793a84f9e5
--- a/FLUSH.cpp Mon Jun 10 19:06:21 2013 +0000
+++ b/FLUSH.cpp Thu Jul 11 13:34:53 2013 +0000
@@ -28,20 +28,20 @@
void
MODSERIAL::flushBuffer(IrqType type)
{
- uint32_t ier = _IER;
+ uint32_t irq_req = MODSERIAL_IRQ_REG;
switch(type) {
- case TxIrq: _IER &= ~(1UL << 1); break;
- case RxIrq: _IER &= ~(1UL << 0); break;
+ case TxIrq: DISABLE_TX_IRQ; break;
+ case RxIrq: DISABLE_RX_IRQ; break;
}
buffer_in[type] = 0;
buffer_out[type] = 0;
buffer_count[type] = 0;
buffer_overflow[type] = 0;
switch(type) {
- case TxIrq: _FCR = MODSERIAL_FIFO_TX_RESET; break;
- case RxIrq: _FCR = MODSERIAL_FIFO_RX_RESET; break;
+ case TxIrq: RESET_TX_FIFO; break;
+ case RxIrq: RESET_RX_FIFO; break;
}
- _IER = ier;
+ MODSERIAL_IRQ_REG = irq_req;
}
}; // namespace AjK ends
