* report alarm shutdown event at 5%
* pay attention to : debounce
*/
- if (percent >0 && percent <= BATTERY_LOWPOWER_ALARM_POWERLEVEL && low_power_flag_1)
+ if (percent >0 && percent <= BATTERY_LOWPOWER_ALARM_POWERLEVEL)
{
low_power_play_toUI(0);
- low_power_flag_1=0;
- }else if (percent <= BATTERY_LOWPOWER_ALARM_SHUTDOWNLEVEL && low_power_flag_2)
+
+ }else if (percent <= BATTERY_LOWPOWER_ALARM_SHUTDOWNLEVEL )
{
low_power_play_toUI(1);
- low_power_flag_2=0;
+
}
}
#endif
errcode_t Play_shutdown_animation_notify(uint8_t alarm_level)
{
+ if(alarm_level==0 && low_power_flag_1)
+ low_power_flag_1=0;
+ else if(alarm_level==1 && low_power_flag_2)
+ low_power_flag_2=0;
+
ChargerEventPublish(TOPIC_EVENT_LOWPOWER_ALARM,alarm_level);
return 0;
}
{
/**通过UI事件发送Notify*/
+
GraphicService::GetInstance()->PostGraphicEvent(std::bind(Play_shutdown_animation_notify, alarm_level));
return ERRCODE_SUCC;