|
@@ -27,7 +27,11 @@ static const DigitalPort LCD_RS = DigitalPort::D18 ;
|
|
|
|
|
|
static const DigitalPort LCD_E = DigitalPort::D17 ;
|
|
|
|
|
|
-// UTILITY ROUTINES — ANY MODE *
|
|
|
+// SEMAPHORE
|
|
|
+
|
|
|
+static Semaphore sem(1);
|
|
|
+
|
|
|
+// UTILITY ROUTINES — ANY MODE
|
|
|
|
|
|
static void driveHighE (void) {
|
|
|
digitalWrite (LCD_E, true) ;
|
|
@@ -173,6 +177,8 @@ static void write8bitCommand (USER_MODE_ const uint8_t inCommand) {
|
|
|
|
|
|
|
|
|
static void writeData (USER_MODE_ const uint8_t inData) {
|
|
|
+ sem.P(MODE);
|
|
|
+
|
|
|
waitDuring (MODE_ 1) ;
|
|
|
driveHighRS () ;
|
|
|
programLcd4BitDataBusOutput (inData >> 4) ;
|
|
@@ -184,6 +190,8 @@ static void writeData (USER_MODE_ const uint8_t inData) {
|
|
|
driveHighE () ;
|
|
|
waitDuring (MODE_ 1) ;
|
|
|
driveLowE () ;
|
|
|
+
|
|
|
+ sem.V(MODE);
|
|
|
}
|
|
|
|
|
|
// PRINT ROUTINES — USER MODE
|