x7/x9e startup review (#5033)

* Turn on X7 like it is done on X9

* 4 squares like shutdown + prep for firmware option to disable

* Compile option

* - rollback firmware option
- fast one second power on
- unchanged power off
- animation added for x7 power on
- animation for power off changed to 'removing' quarter instead of adding (ie the power on anim fills in, the power down fills out)

* Cosmetics

* Cosmetics
This commit is contained in:
3djc
2017-06-18 20:55:49 +02:00
committed by Bertrand Songis
parent 4226e9cc45
commit 4c40aec8b3
3 changed files with 22 additions and 7 deletions
+19 -4
View File
@@ -100,10 +100,11 @@ extern "C" void INTERRUPT_5MS_IRQHandler()
}
#endif
#if defined(PCBX9E) && !defined(SIMU)
#define PWR_PRESS_DURATION_MIN 200 // 2s
#if (defined(PCBX9E) || defined(PCBX7)) && !defined(SIMU)
#define PWR_PRESS_DURATION_MIN 100 // 1s
#define PWR_PRESS_DURATION_MAX 500 // 5s
#endif
#if (defined(PCBX9E) && !defined(SIMU))
const pm_uchar bmp_startup[] PROGMEM = {
#include "startup.lbm"
};
@@ -187,10 +188,14 @@ void boardInit()
DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
#endif
#if defined(PCBX9E)
#if defined(PCBX9E) || defined(PCBX7)
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
lcdClear();
#if defined(PCBX9E)
lcdDrawBitmap(76, 2, bmp_lock, 0, 60);
#else
lcdDrawFilledRect(LCD_W / 2 - 18, LCD_H / 2 - 3, 6, 6, SOLID, 0);
#endif
lcdRefresh();
lcdRefreshWait();
@@ -202,7 +207,15 @@ void boardInit()
if (duration < PWR_PRESS_DURATION_MIN) {
unsigned index = duration / (PWR_PRESS_DURATION_MIN / 4);
lcdClear();
#if defined(PCBX9E)
lcdDrawBitmap(76, 2, bmp_startup, index*60, 60);
#else
for(uint8_t i= 0; i < 4; i++) {
if (index >= i) {
lcdDrawFilledRect(LCD_W / 2 - 18 + 10 * i, LCD_H / 2 - 3, 6, 6, SOLID, 0);
}
}
#endif
}
else if (duration >= PWR_PRESS_DURATION_MAX) {
drawSleepBitmap();
@@ -227,7 +240,9 @@ void boardInit()
pwrInit();
backlightInit();
}
#if defined(PCBX9E)
toplcdInit();
#endif
#else
backlightInit();
#endif