Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emergency reset disabled by default #21

Merged
merged 4 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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