Skip to content

Commit 3b40061

Browse files
authored
Merge pull request #21 from ALittleSlow/master
emergency reset disabled by default
2 parents 83fb750 + 83d993e commit 3b40061

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

firmware/OpenLCD/Setting_Control.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void changeIgnore()
2626

2727
SerLCD.print(F("Ignore RX O"));
2828

29-
if (settingIgnoreRX == true)
29+
if (settingIgnoreRX == false)
3030
SerLCD.print(F("FF"));
3131
else
3232
SerLCD.print(F("N"));

firmware/OpenLCD/System_Functions.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ void setupUART()
8888
{
8989
//Check to see if we are ignoring the RX reset or not
9090
settingIgnoreRX = EEPROM.read(LOCATION_IGNORE_RX);
91-
if (settingIgnoreRX > 1)
92-
{
93-
settingIgnoreRX = false; //Don't ignore
94-
EEPROM.update(LOCATION_IGNORE_RX, settingIgnoreRX);
95-
}
9691

9792
if (settingIgnoreRX == false) //If we are NOT ignoring RX, then
9893
checkEmergencyReset(); //Look to see if the RX pin is being pulled low
@@ -344,7 +339,6 @@ void checkEmergencyReset(void)
344339
pinMode(rxPin, INPUT_PULLUP); //Turn the RX pin into an input with pullups
345340

346341
if (digitalRead(rxPin) == HIGH) return; //Quick pin check
347-
348342
//Wait 2 seconds, blinking backlight while we wait
349343
pinMode(BL_RW, OUTPUT);
350344
digitalWrite(BL_RW, HIGH); //Set the STAT2 LED
@@ -367,7 +361,15 @@ void checkEmergencyReset(void)
367361
for (int x = 0 ; x < 200 ; x++) EEPROM.update(x, 0xFF);
368362

369363
//Change contrast without notification message
370-
analogWrite(LCD_CONTRAST, 40); //Set contrast to default
364+
analogWrite(LCD_CONTRAST, DEFAULT_CONTRAST_LCD); //Set contrast to default
365+
366+
//Force ignoreRX to false.
367+
EEPROM.update(LOCATION_IGNORE_RX, false);
368+
369+
//Change backlight to defaults
370+
changeBLBrightness(RED, DEFAULT_RED);
371+
changeBLBrightness(GREEN, DEFAULT_GREEN);
372+
changeBLBrightness(BLUE, DEFAULT_BLUE);
371373

372374
SerLCD.clear();
373375
SerLCD.print("System reset");

firmware/OpenLCD/settings.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535
const byte DEFAULT_TWI_ADDRESS = 0x72; //0x71 for Serial7Segment. 0x72 for SerLCD.
3636
const byte DEFAULT_BAUD = BAUD_9600; //9600 for 8MHz, 2x speed
37-
const byte DEFAULT_BRIGHTNESS = 255; //100%, full brightness
37+
const byte DEFAULT_RED = 255;
38+
const byte DEFAULT_GREEN = 255;
39+
const byte DEFAULT_BLUE = 255;
3840
const byte DEFAULT_LINES = 2;
3941
const byte DEFAULT_WIDTH = 16;
4042
const byte DEFAULT_SPLASH = true; //Default on

0 commit comments

Comments
 (0)