version 0.9.7

master
ThinkPad-T460P 2021-03-18 12:23:23 +08:00
parent 2e42c6ddbf
commit 5da6ab717f
4 changed files with 7 additions and 6 deletions

View File

@ -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;
}
}
// }
}

View File

@ -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]");

View File

@ -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();

View File

@ -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()