/******************************************************************************* Key status detect Return: KeyIn *******************************************************************************/ void Keys_Detect(void) { static u16 Key_Last; u16 Key_Now = 0,KeyCode = 0; if(Key_UPD == 1){ Key_UPD = 0; Key_Now = __Info(KEY_IN); if(Key_Now &(~Key_Last)){ Key_Wait_Cnt = 50; // 重置持续按键 1.0S 计数 Key_Repeat_Cnt = 3; // 设定 60mS 自动重复周期 if(Key_Now & 0x01) KeyCode = K_PWR; if(Key_Now & 0x02) Tmp_RUN = K_RUN; } else{ KeyCode = Touch_Motion(); // 触摸板 if(Key_Now & Key_Last){ if((Key_Wait_Cnt < 25)&&(Key_Repeat_Cnt == 0)){//持续按键 0.5S 以上 if(Key_Now & 0x3C) Key_Repeat_Cnt = 3; //设定 60mS 自动重复周期 } if((Key_Wait_Cnt == 0)&&(Key_Repeat_Cnt == 0)){ if(Key_Now & 0x02){KeyCode = RUN_HOLD,Tmp_RUN = 0;} if(Key_Now & 0x03) Key_Repeat_Cnt = 25; //设定 1.0S 自动重复周期 } }else { if(Tmp_RUN) {KeyCode = Tmp_RUN; Tmp_RUN = 0;} Key_Wait_Cnt=50; } } Key_Last = Key_Now; KeyIn = KeyCode; } }
void tool::source::Column::Maximum(SizeType value) { if (IsDebug()) { __Info("Column Maximum = %zu", value); } m_maximum = value; }
/******************************************************************************* TIM6_ISP: 定时中断处理程序 1ms *******************************************************************************/ void TIM6_ISP(void) { u16 i,Vusb; if((++Cnt_mS%20 )== 0){ if(PopCnt > 40) PopCnt -= 20; else if(PopCnt > 20) { PopCnt = 0; if(!(PopType & (DAILOG_POP|PWR_POP))){ if(PopType & FILE_POP){ //如果是文件管理子窗口,恢复打开时的当前页和选项 menu.current = Menu_Temp[0]; menu.menu_index[menu.current] = Menu_Temp[1]; } ClosePop(); //DAILOG_POP对话框不自动关闭 } Windows_Flag = 0; //关闭windows if(Windows_Flag == 0){ //清除小窗口 后期放到定时器处理 Clr_WavePosi(DAR); } } //------------电量检测------------------ if(Cnt_mS == 1000){ Cnt_mS = 0; Vbat = __Info(P_VBAT); Vusb = __Info(P_VUSB); Ichg = __Info(P_ICHG); for(i=0; i<4; i++) if(Vbat <= V_BT[i]) break; if(Vusb > 4200){ if(Ichg < 10) Battery = 6; else Battery = 5; } else Battery = i; //----------------待机---------------- if((PopMenu3_Value[SYS_Standy]!=0)&& (PD_Cnt > 0)) PD_Cnt--; //待机记时 if((PopMenu3_Value[SYS_PowerOff]!=0)&& (AutoPwr_Cnt > 0)) AutoPwr_Cnt--; //自动关机记时 } } }
void tool::source::Column::Newline(const SizeType& column, std::string string) { if (column > m_maximum) { __Error("Check Column Failed: columns greater than %zu (Column = %zu) " ", file %s, line %zu, string \"%s\"", m_maximum, column, m_read.Pathname().c_str(), m_line, string.c_str()); } else { if (IsDebug()) { __Info("line %zu, column %zu, string \"%s\"", m_line, column, string.c_str()); } } ++m_line; }