Browse Source

Make sure SerialLCD does not show a splash screen

Thomas Buck 3 years ago
parent
commit
cfb10e9620
3 changed files with 21 additions and 0 deletions
  1. 4
    0
      include/SerialLCD.h
  2. 1
    0
      src/Functionality.cpp
  3. 16
    0
      src/SerialLCD.cpp

+ 4
- 0
include/SerialLCD.h View File

@@ -20,6 +20,10 @@ public:
20 20
     void clear(void);
21 21
     void setBacklight(uint8_t val);
22 22
     
23
+    void saveSplash(void);
24
+    void enableSplash(void);
25
+    void disableSplash(void);
26
+    
23 27
     // 0 no cursor, 1 underline, 2 blinking, 3 both
24 28
     void cursor(int style);
25 29
     

+ 1
- 0
src/Functionality.cpp View File

@@ -291,6 +291,7 @@ void ui_setup(void) {
291 291
     debug.println("Setting up LCD, please wait");
292 292
     delay(1000); // give LCD some time to boot
293 293
     lcd.init();
294
+    lcd.disableSplash();
294 295
     
295 296
 #ifdef DEBUG_WAIT_FOR_SERIAL_CONN
296 297
     lcd.write(0, "Waiting for serial");

+ 16
- 0
src/SerialLCD.cpp View File

@@ -1,3 +1,5 @@
1
+// see https://github.com/sparkfun/SparkFun_SerLCD_Arduino_Library
2
+
1 3
 #include <Arduino.h>
2 4
 #include "SerialLCD.h"
3 5
 
@@ -83,6 +85,20 @@ void SerialLCD::position(int line, int col) {
83 85
     delay(LCD_DELAY);
84 86
 }
85 87
 
88
+void SerialLCD::saveSplash(void) {
89
+    lcd->write(0x7C);
90
+    lcd->write(0x0A);
91
+}
92
+
93
+void SerialLCD::enableSplash(void) {
94
+    lcd->write(0x7C);
95
+    lcd->write(0x30);
96
+}
97
+
98
+void SerialLCD::disableSplash(void) {
99
+    lcd->write(0x7C);
100
+    lcd->write(0x31);
101
+}
86 102
 void SerialLCD::write(const char *text) {
87 103
     lcd->print(text);
88 104
     delay(LCD_DELAY);

Loading…
Cancel
Save