Skip to content

Commit

Permalink
Merge pull request #21 from ALittleSlow/master
Browse files Browse the repository at this point in the history
emergency reset disabled by default
  • Loading branch information
nseidle authored Mar 18, 2019
2 parents 83fb750 + 83d993e commit 3b40061
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion firmware/OpenLCD/Setting_Control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void changeIgnore()

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

if (settingIgnoreRX == true)
if (settingIgnoreRX == false)
SerLCD.print(F("FF"));
else
SerLCD.print(F("N"));
Expand Down
16 changes: 9 additions & 7 deletions firmware/OpenLCD/System_Functions.ino
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ void setupUART()
{
//Check to see if we are ignoring the RX reset or not
settingIgnoreRX = EEPROM.read(LOCATION_IGNORE_RX);
if (settingIgnoreRX > 1)
{
settingIgnoreRX = false; //Don't ignore
EEPROM.update(LOCATION_IGNORE_RX, settingIgnoreRX);
}

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

if (digitalRead(rxPin) == HIGH) return; //Quick pin check

//Wait 2 seconds, blinking backlight while we wait
pinMode(BL_RW, OUTPUT);
digitalWrite(BL_RW, HIGH); //Set the STAT2 LED
Expand All @@ -367,7 +361,15 @@ void checkEmergencyReset(void)
for (int x = 0 ; x < 200 ; x++) EEPROM.update(x, 0xFF);

//Change contrast without notification message
analogWrite(LCD_CONTRAST, 40); //Set contrast to default
analogWrite(LCD_CONTRAST, DEFAULT_CONTRAST_LCD); //Set contrast to default

//Force ignoreRX to false.
EEPROM.update(LOCATION_IGNORE_RX, false);

//Change backlight to defaults
changeBLBrightness(RED, DEFAULT_RED);
changeBLBrightness(GREEN, DEFAULT_GREEN);
changeBLBrightness(BLUE, DEFAULT_BLUE);

SerLCD.clear();
SerLCD.print("System reset");
Expand Down
4 changes: 3 additions & 1 deletion firmware/OpenLCD/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@

const byte DEFAULT_TWI_ADDRESS = 0x72; //0x71 for Serial7Segment. 0x72 for SerLCD.
const byte DEFAULT_BAUD = BAUD_9600; //9600 for 8MHz, 2x speed
const byte DEFAULT_BRIGHTNESS = 255; //100%, full brightness
const byte DEFAULT_RED = 255;
const byte DEFAULT_GREEN = 255;
const byte DEFAULT_BLUE = 255;
const byte DEFAULT_LINES = 2;
const byte DEFAULT_WIDTH = 16;
const byte DEFAULT_SPLASH = true; //Default on
Expand Down

0 comments on commit 3b40061

Please sign in to comment.