1
0
forked from me/IronOS

Add ability to start into sleep

This commit is contained in:
Ben V. Brown
2017-08-09 10:07:34 +10:00
parent 8cc7d452ce
commit 9969c66520
5 changed files with 19 additions and 10 deletions

View File

@@ -14,13 +14,15 @@ void setup();
int main(void) {
setup();/*Setup the system*/
if (systemSettings.autoStart)
if (systemSettings.autoStart == 1)
operatingMode = SOLDERING;
else if (systemSettings.autoStart == 2)
operatingMode = SLEEP;
while (1) {
Clear_Watchdog(); //reset the Watch dog timer
ProcessUI();
DrawUI();
OLED_Sync();//Write out the screen buffer
OLED_Sync(); //Write out the screen buffer
delayMs(15); //Slow the system down waiting for the iron.
if (systemSettings.OrientationMode == 2) {
@@ -28,8 +30,7 @@ int main(void) {
if (RotationChangedFlag) {
OLED_SetOrientation(!getOrientation());
RotationChangedFlag = 0;
}
else if (GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_3) == Bit_RESET) {
} else if (GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_3) == Bit_RESET) {
OLED_SetOrientation(!getOrientation());
RotationChangedFlag = 0;
//^ This is a workaround for the IRQ being set off before we have the handler setup and enabled.