[Taranis X9E] Second version for the startup procedure
This commit is contained in:
@@ -123,7 +123,7 @@ void boardInit()
|
|||||||
init5msTimer();
|
init5msTimer();
|
||||||
__enable_irq();
|
__enable_irq();
|
||||||
|
|
||||||
#if defined(REV9E)
|
#if 0 // first version
|
||||||
if (!(RCC->CSR & (RCC_CSR_SFTRSTF | RCC_CSR_WDGRSTF))) {
|
if (!(RCC->CSR & (RCC_CSR_SFTRSTF | RCC_CSR_WDGRSTF))) {
|
||||||
tmr10ms_t start = get_tmr10ms();
|
tmr10ms_t start = get_tmr10ms();
|
||||||
while (pwrPressed());
|
while (pwrPressed());
|
||||||
@@ -134,6 +134,27 @@ void boardInit()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(REV9E) // second version
|
||||||
|
if (!(RCC->CSR & (RCC_CSR_SFTRSTF | RCC_CSR_WDGRSTF))) {
|
||||||
|
tmr10ms_t start = get_tmr10ms();
|
||||||
|
tmr10ms_t duration = 0;
|
||||||
|
uint8_t pwr_on = 0;
|
||||||
|
while (pwrPressed()) {
|
||||||
|
duration = get_tmr10ms() - start;
|
||||||
|
if (duration >= 300) {
|
||||||
|
turnBacklightOff();
|
||||||
|
}
|
||||||
|
else if (duration > 80 && pwr_on != 1) {
|
||||||
|
backlightInit();
|
||||||
|
pwr_on = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (duration < 80 || duration >= 300) {
|
||||||
|
pwrOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
keysInit();
|
keysInit();
|
||||||
adcInit();
|
adcInit();
|
||||||
delaysInit();
|
delaysInit();
|
||||||
|
|||||||
Reference in New Issue
Block a user