1
0
forked from me/IronOS

Fix font erroring char. Add accel lockout for autostart.

Helps for the following issues:
#51
#38
This commit is contained in:
Ben V. Brown
2017-08-11 16:31:04 +10:00
parent ea1b0e2ae3
commit c5c1171112
5 changed files with 18 additions and 6 deletions

View File

@@ -18,6 +18,10 @@ int main(void) {
operatingMode = SOLDERING;
else if (systemSettings.autoStart == 2)
operatingMode = SLEEP;
if (systemSettings.autoStart) {
InterruptMask = 1; //set the mask
lastMovement = 0;
}
while (1) {
Clear_Watchdog(); //reset the Watch dog timer
ProcessUI();
@@ -36,12 +40,17 @@ int main(void) {
//^ This is a workaround for the IRQ being set off before we have the handler setup and enabled.
}
}
if (GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5) == Bit_RESET) {
if ((GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_5) == Bit_RESET)&&!InterruptMask) {
lastMovement = millis();
//This is a workaround for the line staying low as the user is still moving. (ie sensitivity is too high for their amount of movement)
}
delayMs(15); //Slow the system down waiting for the iron.
if (systemSettings.autoStart && (millis() > 10000) && InterruptMask) {
//If the user has setup the device to auto enter a startup mode, we normally have the interrupts on motion masked for the inital 10 seconds to prevent waking up during initalization
//This allows us to re-enable these interrupts.
InterruptMask = 0;
}
}
}
void setup() {