Marking---------factory fun。。。
/** ****************************************************************************** * @file factory.c * @author Huang * @version V0.1 * @date 11/2017 * @brief This file contains all the lcd digit ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm8l15x.h" #include "gd_broad.h" #include "digit.h" #include "disp.h" #include "prog.h" #include "key.h" #include "temper.h" #include "factory.h" void factory_init(void) { sys_type=SYS_FACTORY_TYPE; disp_mode_set(DISP_FACTORY_TEMP_VALUE_MODE); } void factory_func(void) { /*display second*/ if(sys_flag.f.t16hz){ sys_flag.f.t16hz=0; if(sys_flag.f.adc_data){ sys_flag.f.adc_data=0; temper_func(); } key_func(); //digit_d4_d5(key_code); sys_16hz_count++; if((sys_16hz_count&0x1f)==0){ // 2 seconds routine sys_time_update(); ADC_SoftwareStartConv(ADC1); } switch(sys_16hz_count&0x0f){ case 0: sys_flag.f.dsp=1; break; case 8: disp_off_func(); break; } } if(sys_flag.f.dsp==1){ sys_flag.f.dsp=0; if(disp_last_mode!=disp_mode){ disp_last_mode=disp_mode; LCD_Com_Page(0); } disp_func(); } } void factory_disp_temp_value(unsigned char temp, unsigned char dec) { if(temp==0||temp>PROG_TEMP_VALUE_80_DEGREE){ digit_d2_d3_bar(); }else if(temp<PROG_TEMP_VALUE_ZERO_DEGREE){ temp = PROG_TEMP_VALUE_ZERO_DEGREE-temp; digit_d2(11); digit_d3(temp); digit_d1(10-dec); }else{ temp -= PROG_TEMP_VALUE_ZERO_DEGREE; if(temp>=10){ digit_d2_d3(temp); }else{ digit_d2_off(); digit_d3(temp); } digit_d1(dec); } digit_d4_d5_oC(); COL_OFF(); } void factory_disp_func(void) { switch(disp_mode) { case DISP_FACTORY_TEMP_VALUE_MODE: factory_disp_temp_value(temper_value,temper_dec_value); break; } } void factory_disp_off_func(void) { } void factory_disp_mode_set(void) { disp_sub_mode=0; } void factory_key_timeout(void) { } void key_press_factory_func(void) { } void key_release_factory_func(void) { } void key_hold2s_factory_func(void) { } void factory_key_func(void) { switch(key_status){ case KEY_WAIT: break; case KEY_PRESS: key_press_factory_func(); break; case KEY_RELEASE: key_release_factory_func(); break; case KEY_HOLD_2S: key_hold2s_factory_func(); break; } }