void vMillApplet(int init) { if (init) { lcd_DrawRect(STOP_MILL_X1, STOP_MILL_Y1, STOP_MILL_X2, STOP_MILL_Y2, Cyan); lcd_fill(STOP_MILL_X1 + 1, STOP_MILL_Y1 + 1, STOP_MILL_W, STOP_MILL_H, Red); lcd_DrawRect(START_MILL_X1, START_MILL_Y1, START_MILL_X2, START_MILL_Y2, Cyan); lcd_fill(START_MILL_X1 + 1, START_MILL_Y1 + 1, START_MILL_W, START_MILL_H, Green); lcd_DrawRect(BK_X1, BK_Y1, BK_X2, BK_Y2, Cyan); lcd_fill(BK_X1 + 1, BK_Y1 + 1, BK_W, BK_H, Magenta); lcd_printf(10, 1, 18, "MANUAL MILL APPLET"); lcd_printf(22, 4, 13, "START MILL"); lcd_printf(22, 8, 12, "STOP MILL"); lcd_printf(30, 13, 4, "Back"); //create a dynamic display task xTaskCreate( vMillAppletDisplay, ( signed portCHAR * ) "Mill_disp", configMINIMAL_STACK_SIZE + 500, NULL, tskIDLE_PRIORITY, &xMillAppletDisplayHandle); } }
/*------------------------------------------------------------ * Function Name : ShowCalibrationTableAreaOne * Description : 显示标定表区域一个 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void ShowCalibrationTableAreaOne( uint8_t i ) { uint16_t x,y,back_color; uint16_t point_color = COLOR_POINT; if (i > CALIBRATION_MAX_SEGS) { return; } back_color = PidCalibration.color_cal[i]; x = PidCalibration.pos_cal[i].Serial.x; y = PidCalibration.pos_cal[i].Serial.y; lcd_fill(x,y,SERIAL_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_cal[i].Serial); x = PidCalibration.pos_cal[i].Force.x; y = PidCalibration.pos_cal[i].Force.y; lcd_fill(x,y,FORCE_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_cal[i].Force); x = PidCalibration.pos_cal[i].Code.x; y = PidCalibration.pos_cal[i].Code.y; lcd_fill(x,y,CODE_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_cal[i].Code); }
void getIR_test(struct RAWcmd_* cmd) { unsigned char x; struct ir_raw_ capture; lcd_fill(0); draw_string(0,0,"Beide Fernbedienungen\neinander gegenüber\nlegen, so dass die Infra-\nrotschnittstellen direkt\nzueinander liegen.\nAbstand 2-10cm\nAnzulernene Taste drücken.", 3, DRAW_PUT); x=captureIR(&capture); lcd_fill(0); draw_numU(90,16,x,0, 3, DRAW_PUT); debug_print_capture(&capture); clear_cmd(cmd); x = analyzeIR(&capture, cmd); //debug_print_cmd(cmd); draw_numU(90,24,x,0, 3, DRAW_PUT); if(x) draw_string(97,24,"FAIL", 3, DRAW_PUT); else draw_string(97,24,"OK", 3, DRAW_PUT); }
void vBoilApplet(int init) { if (init) { lcd_DrawRect(DUTY_UP_X1, DUTY_UP_Y1, DUTY_UP_X2, DUTY_UP_Y2, Red); lcd_fill(DUTY_UP_X1+1, DUTY_UP_Y1+1, DUTY_UP_W, DUTY_UP_H, Blue); lcd_DrawRect(DUTY_DN_X1, DUTY_DN_Y1, DUTY_DN_X2, DUTY_DN_Y2, Red); lcd_fill(DUTY_DN_X1+1, DUTY_DN_Y1+1, DUTY_DN_W, DUTY_DN_H, Blue); lcd_DrawRect(STOP_HEATING_X1, STOP_HEATING_Y1, STOP_HEATING_X2, STOP_HEATING_Y2, Cyan); lcd_fill(STOP_HEATING_X1+1, STOP_HEATING_Y1+1, STOP_HEATING_W, STOP_HEATING_H, Red); lcd_DrawRect(START_HEATING_X1, START_HEATING_Y1, START_HEATING_X2, START_HEATING_Y2, Cyan); lcd_fill(START_HEATING_X1+1, START_HEATING_Y1+1, START_HEATING_W, START_HEATING_H, Green); lcd_DrawRect(BAK_X1, BAK_Y1, BAK_X2, BAK_Y2, Cyan); lcd_fill(BAK_X1+1, BAK_Y1+1, BAK_W, BAK_H, Magenta); lcd_printf(10,1,18, "MANUAL Boil APPLET"); lcd_printf(3,4,11, "Duty UP"); lcd_printf(1,8,13, "Duty DOWN"); lcd_printf(22,4,13, "START BOIL"); lcd_printf(22,8,12, "STOP BOIL"); lcd_printf(30, 13, 4, "Back"); xTaskCreate( vBoilAppletDisplay, ( signed portCHAR * ) "hlt_disp", configMINIMAL_STACK_SIZE + 500, NULL, tskIDLE_PRIORITY , &xBoilAppletDisplayHandle ); } }
void display_init(void) { lcd_init(); lcd_fill(0); //int i; //for(i=0;i<30;i++){ // lcd_setPixel(i,i,true); //} //font_render('\\', 0, 0); //font_renders("foo bar", 20, 0); lcd_display(); //while(1); #if 0 //static uint8_t r = 0; while(1){ //if( r == 0 ) // r = 0xff; //else // r = 0; //lcd_fill(r); lcd_fill(0xAA); lcd_display(); //lcdhal_delayms(500); //lcd_startStream(); //while(x--) // lcd_stream(r,0,0); //lcd_stopStream(); } #endif }
/*------------------------------------------------------------ * Function Name : ShowPidAreaOne * Description : 显示PID区域一个 * Input : None * Output : None * Return : None *------------------------------------------------------------*/ void ShowPidAreaOne( uint8_t i ) { uint16_t x,y,back_color; const uint16_t point_color = COLOR_POINT; if (i > PID_MAX_SEGS) { return; } back_color = PidCalibration.color_pid[i]; x = PidCalibration.pos_pid[i].Serial.x; y = PidCalibration.pos_pid[i].Serial.y; lcd_fill(x,y,SERIAL_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_pid[i].Serial); x = PidCalibration.pos_pid[i].Force.x; y = PidCalibration.pos_pid[i].Force.y; lcd_fill(x,y,FORCE_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_pid[i].Force); x = PidCalibration.pos_pid[i].KP.x; y = PidCalibration.pos_pid[i].KP.y; lcd_fill(x,y,KP_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_pid[i].KP); x = PidCalibration.pos_pid[i].KI.x; y = PidCalibration.pos_pid[i].KI.y; lcd_fill(x,y,KI_LEN,RECTANGLE_WIDTH,back_color); GUI_DispStr24At(x,y,point_color,back_color,PidCalibration.data_pid[i].KI); }
static void timetick(unsigned int systick) { if(expsp_Flag==1)//超速驾驶记录 { ChaoSuNumScreen=0;//显示速度第几屏的序号 expsp_Flag=3;//不LCD_MODE_SET能再此清0,还要进入下一级菜单 lcd_fill(0); lcd_text12(0,10,"按确认键查看超速记录",20,LCD_MODE_SET); lcd_update_all(); } else if(expsp_Flag==2)//无超速驾驶记录 { expsp_Flag=0; lcd_fill(0); lcd_text12(18,10,"无超速驾驶记录",14,LCD_MODE_SET); lcd_update_all(); } CounterBack++; if(CounterBack!=MaxBankIdleTime) return; pMenuItem=&Menu_1_Idle; pMenuItem->show(); CounterBack=0; ErrorRecord=0;//疲劳超速记录错误清0 StartDisTiredExpspeed=0; expsp_Flag=0;//查看超速报警记录过程标志清0; ChaoScreen=1; }
static void brew_run_step() { g_state.step_start_tick = xTaskGetTickCount(); g_state.step_runtime = 0; // iterate will update this lcd_lock(); lcd_fill(0, 0, LCD_W, CRUMB_H, 0x0); lcd_background(0x0); lcd_text(0, 0, "Brewbot:Brewing"); lcd_fill(0, CRUMB_H - 2, LCD_W, 2, 0xFFFF); lcd_fill(0, CRUMB_H, LCD_W, LCD_H - CRUMB_H, COL_BG_NORM); lcd_fill(0, LCD_H - 1 * HH - 1, LCD_W / 2, 1, 0xFFFF); lcd_fill(LCD_W / 2, LCD_H - 1 * HH - 1, 1, HH, 0xFFFF); button_paint(brew_buttons); if (g_steps[g_state.step].buttons) button_paint(g_steps[g_state.step].buttons); lcd_background(COL_BG_NORM); lcd_printf(17, 0, 20, "%d.%s", g_state.step, g_steps[g_state.step].name); lcd_release(); log_brew(&g_state.log_file, "%.2d:%.2d Run step %d.%s\n", g_state.total_runtime / 60, g_state.total_runtime % 60, g_state.step, g_steps[g_state.step].name); g_steps[g_state.step].method(1); }
int main(int argc, char **argv) { std::string dev = "/dev/spidev0.1"; int spi; int r; r = spi_open(&spi, dev, LCD_SPI_MODE, LCD_SPI_BITS_PER_WORD, LCD_SPI_SPEED); if (r < 0) { fprintf(stderr, "Unable to open SPI bus 0.1 , error (%d,%d) : %s", r, errno, strerror(errno)); return 1; } else { std::cout << "SPI 0.1 open." << std::endl; } lcd_init(&spi); std::cout << "Fill black." << std::endl; lcd_fill(&spi, 0x0000); delayms(500); std::cout << "Color test..." << std::endl; for(uint16_t color=0;color <= 0xffff; color++) { lcd_fill2(&spi, 200, 130, 280, 190, color); //delayms(100); } std::cout << "Fill black." << std::endl; lcd_fill(&spi, 0x0000); r = spi_close(&spi); std::cout << "SPI 0.1 closed. (" << ((int)r) << ")" << std::endl; return 0; }
/****************************************************************************** * Function: Auto_line_show () * DESCRIPTION: - 自动换行显示函数 * Input: str 内容 * Input: * Output: * Returns: * * ----------------------------------- * Created By wxg 15-jan-2014 * ------------------------------- ******************************************************************************/ u8 Auto_line_show( u8 *str , u8 len ) { u8 remain_len=0; if(len <=20) { lcd_fill(0); lcd_text12(0,5,str,len-Find_ascii(str ),LCD_MODE_SET); lcd_update_all(); remain_len =Find_ascii(str ); lcd_update_all(); } if(20<len<=40 ) { lcd_fill(0); lcd_text12(0,5,str,20- Find_ascii(str ),LCD_MODE_SET); lcd_text12(0,5,str+20- Find_ascii(str ),len-(20- Find_ascii(str+20- Find_ascii(str ))),LCD_MODE_SET); lcd_update_all(); remain_len =Find_ascii(str )+Find_ascii(str+20- Find_ascii(str )); lcd_update_all(); } if(len>40) { lcd_fill(0); lcd_text12(0,5,str,20-Find_ascii(str ),LCD_MODE_SET); lcd_text12(0,5,str+20-Find_ascii(str ),20-Find_ascii(str+20- Find_ascii(str )),LCD_MODE_SET); lcd_update_all(); remain_len =len-(40-Find_ascii(str )-Find_ascii(str+20- Find_ascii(str ))); lcd_update_all(); } return remain_len ; }
static void keypress(unsigned int key) { switch(KeyValue) { case KeyValueMenu: pMenuItem=&Menu_5_other; pMenuItem->show(); CounterBack=0; concuss_screen=0; break; case KeyValueOk: if(concuss_screen==0) { concuss_screen=1; JT808Conf_struct.concuss_step=concuss_step; Api_Config_Recwrite_Large(jt808,0,(u8*)&JT808Conf_struct,sizeof(JT808Conf_struct)); concuss_dis[9]=concuss_step/10+'0'; concuss_dis[10]=concuss_step%10+'0'; lcd_fill(0); lcd_text12(20,3,"震动级别设置成功",16,LCD_MODE_SET); lcd_text12(30,19,(char *)concuss_dis,sizeof(concuss_dis),LCD_MODE_SET); lcd_update_all(); } break; case KeyValueUP: if(concuss_step==0) concuss_step=79; else if(concuss_step>=1) concuss_step--; concuss_dis[9]=concuss_step/10+'0'; concuss_dis[10]=concuss_step%10+'0'; lcd_fill(0); lcd_text12(30,10,(char *)concuss_dis,sizeof(concuss_dis),LCD_MODE_SET); lcd_update_all(); break; case KeyValueDown: concuss_step++; if(concuss_step>79) concuss_step=0; concuss_dis[9]=concuss_step/10+'0'; concuss_dis[10]=concuss_step%10+'0'; lcd_fill(0); lcd_text12(30,10,(char *)concuss_dis,sizeof(concuss_dis),LCD_MODE_SET); lcd_update_all(); break; } KeyValue=0; }
static void keypress(unsigned int key) { switch(KeyValue) { case KeyValueMenu: pMenuItem=&Menu_9_Urgent;//scr_CarMulTrans; pMenuItem->show(); CounterBack=0; break; case KeyValueOk: if(1==IC_or_test) { lcd_fill(0); //BD1_Tx(BD1_TYPE_ICJC, 0, 1); BD_IC.status=result_Artificial; lcd_text12(10,10,"IC检测指令已发出",16,LCD_MODE_SET); lcd_update_all(); //rt_kprintf("tset-----BD_IC.status %d\r\n",BD_IC.status); } if(2==IC_or_test) { lcd_fill(0); //BD1_Tx(BD1_TYPE_XTZJ,0,2); BD_ZJ.status=result_pending; lcd_text12(4,4,"系统检测指令已发出",18,LCD_MODE_SET); lcd_text12(4,19,"等待回复.....",13,LCD_MODE_SET); lcd_update_all(); BD_ZJ.status=result_Artificial; //rt_kprintf("tset-----BD_ZJ.status %d\r\n",BD_ZJ.status); } //SD_ACKflag.f_Worklist_SD_0701H=1;//按键选择发送电子运单标志 /* 这里添加发送IC检测的标志 */ break; case KeyValueUP: IC_or_test++; if(IC_or_test>2) IC_or_test=1; ic_self(IC_or_test); break; case KeyValueDown: IC_or_test--; if(IC_or_test<1) IC_or_test=2; ic_self(IC_or_test); break; } KeyValue=0; }
static void menu_update(void) { start_time = xTaskGetTickCount(); unsigned char ii; uint16_t bgCol = COL_BG_NORM; lcd_lock(); lcd_background(0); // clear menu bg lcd_fill(0, CRUMB_H, LCD_W, LCD_H - CRUMB_H, bgCol); // draw the crumbs char crumbs[90] = "Brewbot"; for (ii = 1; ii <= g_index; ii++) { strcat(crumbs, ":"); strcat(crumbs, g_menu[ii-1][g_crumbs[ii-1]].text); } lcd_fill(0, 0, LCD_W, CRUMB_H, 0x0); lcd_text(0, 0, crumbs); lcd_fill(0, CRUMB_H - 2, LCD_W, 2, 0xFFFF); // how big is the menu? g_entries = 0; for (ii = 0; g_menu[g_index][ii].text; ii++) { g_entries++; } // if above a certain size draw in two columns if (g_entries > 4) { menu_two_column(); } else { g_rows = g_entries; g_rowh = (240 - CRUMB_H) / g_entries; for (ii = 0; g_menu[g_index][ii].text; ii++) { menu_paint_cell(ii); if (ii != g_entries - 1) lcd_fill(0, CRUMB_H + (ii +1) * (g_rowh) - 1, LCD_W, 1, 0xFFFF); } } lcd_printf(30, 0, 10, "%dms", (xTaskGetTickCount() - start_time)); lcd_release(); }
void gui_drawHome(void) { lcd_draw_line(0, 290, 239, 290, BLACK); lcd_show_str(88, 290, "HOME", BLUE); lcd_fill(APP1_X-20, APP1_Y, APP1_X+140, APP1_Y+65, GRAYBLUE); lcd_show_str(APP1_X, APP1_Y, "Swinging around", BRRED); lcd_fill(APP2_X-20, APP2_Y, APP2_X+140, APP2_Y+65, GRAYBLUE); lcd_show_str(APP2_X, APP2_Y, "Starts swinging", BRRED); lcd_fill(APP3_X-20, APP3_Y, APP3_X+140, APP3_Y+65, GRAYBLUE); lcd_show_str(APP3_X, APP3_Y, "Inverted pendulum", BRRED); lcd_fill(APP4_X-20, APP4_Y, APP4_X+140, APP4_Y+65, GRAYBLUE); lcd_show_str(APP4_X, APP4_Y, "Circular motion", BRRED); }
void vMillAppletDisplay(void *pvParameters) { static char tog = 0; //toggles each loop for (;;) { xSemaphoreTake(xAppletRunningSemaphore, portMAX_DELAY); //take the semaphore so that the key handler wont //return to the menu system until its returned switch (xMillState) { case MILL_DRIVING: { if (tog) { lcd_fill(1, 220, 180, 29, Black); lcd_printf(1, 13, 15, "MILL DRIVING"); } else { lcd_fill(1, 210, 180, 17, Black); } break; } case MILL_STOPPED: { if (tog) { lcd_fill(1, 210, 180, 29, Black); lcd_printf(1, 13, 11, "MILL STOPPED"); } else { lcd_fill(1, 210, 180, 17, Black); } break; } default: { break; } } tog = tog ^ 1; xSemaphoreGive(xAppletRunningSemaphore); //give back the semaphore as its safe to return now. vTaskDelay(500); } }
//驾驶员代码 void Display_driver(u8 drivercar) { u8 color_disp[4]; switch(drivercar) { case 1: //车牌号JT808Conf_struct.Vechicle_Info.Vech_Num memcpy(vech_num+7,JT808Conf_struct.Vechicle_Info.Vech_Num,8); //车辆颜色 memset(color_disp,0,sizeof(color_disp)); switch(JT808Conf_struct.Vechicle_Info.Dev_Color) { case 1: memcpy(color_disp,"蓝色",4);break; case 2:memcpy(color_disp,"黄色",4);break; case 3:memcpy(color_disp,"黑色",4);break; case 4:memcpy(color_disp,"白色",4);break; case 9:memcpy(color_disp,"其他",4);break; default:memcpy(color_disp,"蓝色",4);break; } lcd_fill(0); lcd_text12(10,3,(char *)vech_num,15,LCD_MODE_SET); lcd_text12(10,19,"车牌颜色:",9,LCD_MODE_SET); lcd_text12(64,19,color_disp,4,LCD_MODE_SET); lcd_update_all(); break; case 2://车辆ID Vechicle_Info.DevicePhone lcd_fill(0); memcpy(vech_type+9,JT808Conf_struct.Vechicle_Info.Vech_Type,6); lcd_text12(0,3,(char *)vech_type,19,LCD_MODE_SET); //读取设备速度取得是GPS速度还是速度线速度 if(JT808Conf_struct.DF_K_adjustState) lcd_text12(0,18,"设备速度:传感器速度",19,LCD_MODE_SET); else lcd_text12(0,18,"设备速度:GPS速度",16,LCD_MODE_SET); lcd_update_all(); break; case 3: // 车辆ID及车辆sim卡号码 memcpy(vech_ID+7,IMSI_CODE+3,12); memcpy(vech_sim+8,JT808Conf_struct.Vechicle_Info.Vech_sim,12); lcd_fill(0); lcd_text12(0,3,(char *)vech_ID,19,LCD_MODE_SET); lcd_text12(0,18,(char *)vech_sim,20,LCD_MODE_SET); lcd_update_all(); break; default: break; } }
void m_cal_submenu(char key) { uint8_t cal; m_reset_timer(); m_state=CAL; cal = OSCCAL; switch(key) { case KC_D1: { cal++; break; } case KC_D2: { cal--; break; } case KC_EXIT: { m_timer=0; break; } } OSCCAL = cal; lcd_cpos(0); pputchar('x',cal,0); lcd_fill(); }
static void show(void) { //MenuIdle_working=0;//clear lcd_fill(0); lcd_text12(20, 10,"SIM¿¨Ç··Ñ",9, LCD_MODE_SET); lcd_update_all(); }
static void show(void) { lcd_fill(0); lcd_text12(0,2,"按确认键发系统自检",18,LCD_MODE_SET); lcd_text12(0,18,"指令",4,LCD_MODE_SET); lcd_update_all(); }
static void keypress(unsigned int key) { switch(KeyValue) { case KeyValueMenu: pMenuItem=&Menu_9_Urgent;//scr_CarMulTrans; pMenuItem->show(); CounterBack=0; break; case KeyValueOk: BD1_Tx(BD1_TYPE_XTZJ,0,2); lcd_fill(0); lcd_text12(4,4,"系统检测指令已发出",18,LCD_MODE_SET); lcd_update_all(); //SD_ACKflag.f_Worklist_SD_0701H=1;//按键选择发送电子运单标志 /* 这里添加发送系统检测的标志 */ break; case KeyValueUP: break; case KeyValueDown: break; } KeyValue=0; }
/* ������ԥ���� ������³������� ����ʽ����¼���������ش����� */ void license_input(unsigned char par) { lcd_fill(0); switch(par) { case 1: lcd_text12(0,20,"������ԥ���ɺ���",20,LCD_MODE_SET); break; case 2: lcd_text12(0,20,"��³������Ӷ���ʽ�",20,LCD_MODE_SET); break; case 3: lcd_text12(0,20,"���¼���������ش���",20,LCD_MODE_SET); break; case 4: lcd_text12(0,20,"��",2,LCD_MODE_SET); break; case 5: lcd_text12(0,20,"0123456789ABCDEFGHIJ",20,LCD_MODE_SET); break; case 6: lcd_text12(0,20,"KLMNOPQRSTUVWXYZ",16,LCD_MODE_SET); break; default: break; } lcd_update_all(); }
static void timetick(unsigned int systick) { CounterBack++; if(BD_ZJ.flag_send ==result_success) { lcd_fill(0); lcd_text12(10,5,"波束状况 ",10,LCD_MODE_SET); BD1_control.BD_Signal=BD1_control.BD_Signal+'0'; lcd_text12(84,5,(char*)(&(BD1_control.BD_Signal)),1,LCD_MODE_SET); lcd_text12(10,19,"信号强度 ",10,LCD_MODE_SET); if(((BD1_control.BD_Signal-'0')>0)&&(BD1_control.BD_Signal-'0')<=2) lcd_text12(84,19,"较差",4,LCD_MODE_SET); if(((BD1_control.BD_Signal-'0')>2)&&(BD1_control.BD_Signal-'0')<=4) lcd_text12(84,19,"良好",4,LCD_MODE_SET); if(((BD1_control.BD_Signal-'0')>4)&&(BD1_control.BD_Signal-'0')<=6) lcd_text12(84,19,"优",2,LCD_MODE_SET); if(((BD1_control.BD_Signal-'0')==0)) { lcd_text12(84,19,"无信号",6,LCD_MODE_SET); } lcd_update_all(); BD_ZJ.flag_send=0; } if(CounterBack!=MaxBankIdleTime) return; pMenuItem=&Menu_1_Idle; pMenuItem->show(); CounterBack=0; }
static void timetick(unsigned int systick) { //u8 Reg_buf[22]; if(reset_firstset==6) { reset_firstset++; //---------------------------------------------------------------------------------- JT808Conf_struct.password_flag=0; // clear first flag Api_Config_Recwrite_Large(jt808,0,(u8*)&JT808Conf_struct,sizeof(JT808Conf_struct)); //---------------------------------------------------------------------------------- } else if((reset_firstset>=7)&&(reset_firstset<=1207))//50ms一次,,60s { if(reset_firstset==1207) reset_firstset=0; lcd_fill(0); lcd_text12(0,3,"需重新设置车牌号和ID",20,LCD_MODE_SET); lcd_text12(24,18,"重新加电查看",12,LCD_MODE_SET); lcd_update_all(); } else { if(Antenna_open_flag) return; //循环显示待机界面 tickcount++; if(tickcount>=10) { tickcount=0; Disp_Idle(); } } }
void vTaskDS1820DisplayTemps( void *pvParameters){ //char lcd_string[20]; static int count = 0; float fTempHLT = 0, fTempMash = 0; lcd_printf(1,1, 12, "TEMPERATURES"); for (;;) { xSemaphoreTake(xAppletRunningSemaphore, portMAX_DELAY); //take the semaphore so that the key handler wont //return to the menu system until its returned fTempHLT = ds1820_get_temp(HLT); fTempMash = ds1820_get_temp(MASH); //fTempCabinet = ds1820_get_temp(CABINET); count++; lcd_fill(1,50, 200, 190, Dark_Green); lcd_printf(1, 5, 10, "HLT = %u.%u", (unsigned int)floor(fTempHLT), (unsigned int)((fTempHLT-floor(fTempHLT))*pow(10, 3))); lcd_printf(1, 6, 10, "MASH = %u.%u", (unsigned int)floor(fTempMash), (unsigned int)((fTempMash-floor(fTempMash))*pow(10, 3))); lcd_printf(1, 7, 10, "LitresinBoiler = %u.%u", (unsigned int)floor(fGetLitresCurrentlyInBoiler()), (unsigned int)((fGetLitresCurrentlyInBoiler()-floor(fGetLitresCurrentlyInBoiler()))*pow(10, 3))); lcd_printf(1, 8, 10, "IsEnoughWater = %s", (GetBoilerState().level == HIGH) ? "True" : "False"); // lcd_printf(1, 7, 10, "Cabinet = %u.%u", (unsigned int)floor(fTempCabinet), (unsigned int)((fTempCabinet-floor(fTempCabinet))*pow(10, 3))); xSemaphoreGive(xAppletRunningSemaphore); //give back the semaphore as its safe to return now. vTaskDelay(500); } }
static void display( void ) { invert++; invert %= 2; lcd_fill( 0 ); if( row > 1 ) /*设置完成*/ { strcpy( jt808_param.id_0xF00A, car_type1[row0_selected] ); strcat( jt808_param.id_0xF00A, car_type2[col] ); param_save( 1 ); lcd_text12( 13, 16, "车辆类型设置完成", 16, LCD_MODE_SET ); }else { lcd_text12( 20, 4, car_type1[0], 4, LCD_MODE_SET ); lcd_text12( 44, 4, car_type1[1], 4, LCD_MODE_SET ); lcd_text12( 68, 4, car_type1[2], 4, LCD_MODE_SET ); lcd_text12( 92, 4, car_type1[3], 4, LCD_MODE_SET ); lcd_text12( 20, 18, car_type2[0], 4, LCD_MODE_SET ); lcd_text12( 44, 18, car_type2[1], 4, LCD_MODE_SET ); lcd_text12( 68, 18, car_type2[2], 4, LCD_MODE_SET ); lcd_text12( 92, 18, car_type2[3], 4, LCD_MODE_SET ); if( row == 0 ) /*操作第一行*/ { lcd_text12( 20 + col * 24, 4, car_type1[col], 4, invert * 2 + 1 ); /*闪烁 1 set 3 invert*/ }else if( row == 1 ) { lcd_text12( 20 + row0_selected * 24, 4, car_type1[row0_selected], 4, LCD_MODE_INVERT ); lcd_text12( 20 + col * 24, 18, car_type2[col], 4, invert * 2 + 1 ); /*闪烁 1 set 3 invert*/ } } lcd_update_all( ); }
static void show(void) { lcd_fill(0); lcd_text12(24,3,"查看设置信息",12,LCD_MODE_SET); lcd_text12(30,18,"请按确认键",10,LCD_MODE_SET); lcd_update_all(); }
void vTaskDS1820DisplayTemps( void *pvParameters) { //char lcd_string[20]; static int count = 0; lcd_printf(1,1, 12, "TEMPERATURES"); for (;;) { xSemaphoreTake(xAppletRunningSemaphore, portMAX_DELAY); //take the semaphore so that the key handler wont //return to the menu system until its returned count++; //portENTER_CRITICAL(); lcd_fill(1,50, 200, 190, Black); lcd_printf(1, 5, 10, "HLT = %.2f", ds1820_get_temp(HLT)); lcd_printf(1, 6, 10, "Mash = %.2f", ds1820_get_temp(MASH)); lcd_printf(1, 7, 10, "Cabinet = %.2f", ds1820_get_temp(CABINET)); lcd_printf(1, 8, 10, "Ambient = %.2f", ds1820_get_temp(AMBIENT)); lcd_printf(1, 9, 10, "HLT_SSR = %.2f", ds1820_get_temp(HLT_SSR)); lcd_printf(1, 10, 10, "BOIL_SSR = %.2f", ds1820_get_temp(BOIL_SSR)); //printf("Display High water = %u\r\n",uxTaskGetStackHighWaterMark(NULL)); //portEXIT_CRITICAL(); xSemaphoreGive(xAppletRunningSemaphore); //give back the semaphore as its safe to return now. vTaskDelay(500); } }
static void show(void) { lcd_fill(0); lcd_text12(20,3,"您有一条新消息",14,LCD_MODE_SET); lcd_text12(26,19,"按确认键查看",12,LCD_MODE_SET); lcd_update_all(); }
static void Dis_DriverInfor(unsigned char type,unsigned char disscreen) { lcd_fill(0); if(type==1) { if(disscreen==1) { lcd_text12(0, 3,"1.驾驶员信息查看",16,LCD_MODE_INVERT); lcd_text12(0,19,"2.驾驶员信息发送",16,LCD_MODE_SET); } else if(disscreen==2) { lcd_text12(0, 3,"1.驾驶员信息查看",16,LCD_MODE_SET); lcd_text12(0,19,"2.驾驶员信息发送",16,LCD_MODE_INVERT); } } else if(type==2) { if(disscreen==1) lcd_text12(0,10,"按确认发送驾驶员信息",20,LCD_MODE_SET); else if(disscreen==2) lcd_text12(5,10,"驾驶员信息发送成功",18,LCD_MODE_SET); } lcd_update_all(); }
/****************************************************************************** * Function: First_show () * DESCRIPTION: - 每一次带有信息条号的显示 * Input: str 条号 * Input: str2 信息内容 * Output: * Returns: * * ----------------------------------- * Created By wxg 15-jan-2014 * ------------------------------- ******************************************************************************/ void First_show(u8* str2 ,u8 Screen,u8 mode) { #if 1 u32 addre=0; u8 show_buf[20]; //Dis_date[22]={"2000/00/00 00:00:00"}; char T_date[22]={"00/00/00 00:00:00"}; u8 i=0; memset(show_buf,0,20); lcd_fill(0); lcd_text12(0,5,number[Screen],strlen(number[Screen]),mode); for(i=0;i<3;i++) T_date[i*3]=str2[i+5]/10+'0'; for(i=0;i<3;i++) T_date[1+i*3]=str2[i+5]%10+'0'; for(i=0;i<3;i++) T_date[9+i*3]=str2[i+5+3]/10+'0'; for(i=0;i<3;i++) T_date[10+i*3]=str2[i+5+3]%10+'0'; lcd_text12(strlen(number[Screen])*6,5,T_date,17,mode); //rt_kprintf("mian_screen --%d---%d\r\n",strlen(number[Screen]),Screen); lcd_text12(0,19,"发信地址:",8,mode); OutPrint_HEX("addre", str2+12, 3); addre=(str2[12]<<16)+(str2[13]<<8)+str2[14]; sprintf((char*)show_buf,"%d",addre); lcd_text12(60,19,(char*)show_buf,strlen((char*)show_buf),mode); lcd_update_all(); #endif }