Library for using the LSR SiFlex/ProFlex RF modules with mbed.
Diff: LsrModule.cpp
- Revision:
- 9:98edda6ea79e
- Parent:
- 8:10f8dbd8dfff
diff -r 10f8dbd8dfff -r 98edda6ea79e LsrModule.cpp
--- a/LsrModule.cpp Mon Jul 25 23:40:29 2016 +0000
+++ b/LsrModule.cpp Fri Jul 29 17:36:33 2016 +0000
@@ -132,7 +132,7 @@
ptrHostState = &LsrModule::HostRxWaitForMsgStartByteState;
- attach(this, &LsrModule::RunHostRxStateMachine);
+ //attach(this, &LsrModule::RunHostRxStateMachine);
} /*** End LsrModule ***/
@@ -915,7 +915,7 @@
*/
void LsrModule::HostRxWaitForMsgStartByteState(void)
{
- if (SerialAvailable() && (SerialRead() == LSR_MODULE_SERIAL_MSG_START_BYTE))
+ while (readable() && (SerialRead() == LSR_MODULE_SERIAL_MSG_START_BYTE))
{
au8UartRxBuffer[u8UartRxBufferIndex++] = LSR_MODULE_SERIAL_MSG_START_BYTE;
ptrHostState = &LsrModule::HostRxGetMsgLengthState;
@@ -929,7 +929,7 @@
*/
void LsrModule::HostRxGetMsgLengthState(void)
{
- if (SerialAvailable())
+ while (readable())
{
u8RxReadByte = SerialRead();
@@ -953,7 +953,7 @@
*/
void LsrModule::HostRxGetMsgTypeState(void)
{
- if (SerialAvailable())
+ while (readable())
{
u8RxReadByte = SerialRead();
@@ -977,7 +977,7 @@
*/
void LsrModule::HostRxWaitToGetRestOfMsgState(void)
{
- if (SerialAvailable())
+ while (readable())
{
u8RxReadByte = SerialRead();
au8UartRxBuffer[u8UartRxBufferIndex++] = u8RxReadByte;
Mark Harris