if vbat <3.75v, go to while(1)
if vbat >3.75v, go to softwareupgrade
if vbat >3.75v, go to softwareupgrade
if(pre_voltage_detect()){
flashmode_low_voltage();
while(1);
}
int pre_voltage_detect()
{
int avg_voltage = 0;
printf(NULL, "N80 pre voltage detect.");
avg_voltage = Get_Voltage();
if(avg_voltage > 3750){
printf(NULL, "download normally.");
return 0;
}
else{
printf(NULL, "go to while(1)");
return 1;
}
}
void flashmode_low_voltage()
{
lcd_printf("low voltage", 0x3D,200,2,FONT_COLOR_RED,FONT_COLOR_GREEN,LCD_DRAWMODE_NORMAL);
}