version 0.9.7
parent
2e42c6ddbf
commit
5da6ab717f
|
@ -168,7 +168,7 @@ void CustBtnLongPressTimerCallback(void *argument)
|
|||
}
|
||||
void PwrBtnShortPressTimerCallback(void *argument)
|
||||
{
|
||||
if(osThreadFlagsGet() & THREAD_FLAG_EXTI_SERVICE_PWR_BTN_INACTIVE){//power_button has released
|
||||
// if(osThreadFlagsGet() & THREAD_FLAG_EXTI_SERVICE_PWR_BTN_INACTIVE){//power_button has released
|
||||
log_v("power button short pressed.");
|
||||
switch(NaviKit.sys.sta){
|
||||
case run: {//som is running, send sleep requeset to operate system
|
||||
|
@ -182,11 +182,11 @@ void PwrBtnShortPressTimerCallback(void *argument)
|
|||
case isp: { }break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
void CustBtnShortPressTimerCallback(void *argument)
|
||||
{
|
||||
if(osThreadFlagsGet() & THREAD_FLAG_EXTI_SERVICE_PWR_BTN_INACTIVE){//power_button has released
|
||||
// if(osThreadFlagsGet() & THREAD_FLAG_EXTI_SERVICE_PWR_BTN_INACTIVE){//power_button has released
|
||||
log_v("custom button short pressed.");
|
||||
switch(NaviKit.sys.sta){
|
||||
case run:{
|
||||
|
@ -199,7 +199,7 @@ void CustBtnShortPressTimerCallback(void *argument)
|
|||
}break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ void StartDefaultTask(void *argument)
|
|||
}else{
|
||||
NaviKit.sys.next_sta = idle;
|
||||
log_i("EC Reset source: [RTC WakeUP]");
|
||||
enter_standby_state(100);
|
||||
enter_standby_state(0);
|
||||
}
|
||||
}else{//judge reset source "power on"
|
||||
log_i("EC Reset source: [PowerON]");
|
||||
|
|
|
@ -101,7 +101,7 @@ int main(void)
|
|||
MX_UART4_Init();
|
||||
MX_ADC1_Init();
|
||||
MX_USART1_UART_Init();
|
||||
MX_RTC_Init();
|
||||
// MX_RTC_Init();
|
||||
|
||||
/* Initialize interrupts */
|
||||
MX_NVIC_Init();
|
||||
|
|
|
@ -65,6 +65,7 @@ void enter_standby_state(uint16_t delay){
|
|||
osDelay(delay);
|
||||
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);//Enable PA0 wakeup function
|
||||
__HAL_RCC_RTC_DISABLE();
|
||||
HAL_RCC_DeInit();
|
||||
HAL_PWR_EnterSTANDBYMode();
|
||||
}
|
||||
void enter_isp_state()
|
||||
|
|
Loading…
Reference in New Issue