modified for nuc472

Dependents:   modbus-over-rs485-sample NTOUEE-mbed-modbus-RTU NuMaker_NuWicam_Lite

Fork of Modbus by Matthew Waddilove

Revision:
2:6ee56c002f64
Parent:
0:274eb57e1df3
diff -r cfde7320b0bf -r 6ee56c002f64 portevent.cpp
--- a/portevent.cpp	Tue Aug 09 08:21:33 2016 +0000
+++ b/portevent.cpp	Thu Aug 18 08:24:37 2016 +0000
@@ -22,10 +22,11 @@
 /* ----------------------- Modbus includes ----------------------------------*/
 #include "mb.h"
 #include "mbport.h"
+#include "mbed.h"
 
 /* ----------------------- Variables ----------------------------------------*/
-static eMBEventType eQueuedEvent;
-static BOOL         xEventInQueue;
+static volatile eMBEventType eQueuedEvent;
+static volatile BOOL         xEventInQueue;
 
 /* ----------------------- Start implementation -----------------------------*/
 BOOL
@@ -53,6 +54,7 @@
         *eEvent = eQueuedEvent;
         xEventInQueue = FALSE;
         xEventHappened = TRUE;
+        //printf("[%s %d] %x\r\n", __func__, __LINE__, *eEvent );    
     }
     return xEventHappened;
 }