C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 1   


C51 COMPILER V9.56.0.0, COMPILATION OF MODULE MENU
OBJECT MODULE PLACED IN .\Objects\menu.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE ..\app\menu.c LARGE OPTIMIZE(8,SPEED) BROWSE INCDIR(..\bsp;..\app) DEBUG
                    - OBJECTEXTEND PRINT(.\Listings\menu.lst) TABS(2) OBJECT(.\Objects\menu.obj)

line level    source

   1          #include "bsp.h"
   2          #include "menu.h"
   3          #include "string.h"
   4          #include "typedef.h"
   5          #include <stdio.h>
   6          #define VLINE2_START 74
   7          #define VLINE1_START 33
   8          static u8 code modelist[5][5]={"STOP","CHG","REPR","DCHG","TEST"};//0停止，1充电，2修复，3放电，4测试
   9          static u8 cur_setting_index=0,cur_status_index=0,cur_mode_index=0;
  10          static u8 code statuslist[10]={26,27,19,0,20,0,24,25,28,20};
  11          void show_main_menu_unit(void)
  12          {
  13   1        bsp_lcd_draw_hline(1,0,127);
  14   1        bsp_lcd_draw_hline(3,0,127);
  15   1        bsp_lcd_draw_hline(5,0,127);
  16   1        bsp_lcd_draw_hline(7,0,127);
  17   1        bsp_lcd_display_str(0,115,"AH",FALSE);
  18   1        bsp_lcd_display_str(0,66,"V",FALSE);
  19   1        bsp_lcd_display_str(2,25,"A",FALSE);
  20   1        bsp_lcd_display_str(2,66,"W",FALSE);
  21   1        bsp_lcd_display_str(2,115,"WH",FALSE);
  22   1        bsp_lcd_display_str(4,12,"Pcs",FALSE);
  23   1        bsp_lcd_display_str(4,98,":",FALSE);
  24   1        bsp_lcd_display_str(6,46,"V",FALSE);
  25   1        bsp_lcd_display_str(6,80,"m",FALSE);
  26   1        bsp_lcd_diplay_unit(6,86,0,FALSE);
  27   1        bsp_lcd_diplay_unit(6,116,1,FALSE);
  28   1        bsp_lcd_draw_vline(VLINE1_START,0,5);
  29   1        bsp_lcd_draw_vline(VLINE2_START,0,5);
  30   1      }
  31          //void show_adj_temp_menu(void)
  32          void show_main_menu(void)
  33          {
  34   1        bsp_lcd_clear(0);
  35   1        cur_setting_index = 0;
  36   1        show_main_menu_unit();
  37   1        
  38   1        //bsp_lcd_display_str(0,4,"STOP",FALSE);
  39   1        //bsp_lcd_display_str(0,36,"500.0",FALSE);
  40   1        //bsp_lcd_display_str(0,77,"123.45",FALSE);
  41   1        bsp_lcd_display_str(2,1,"48.1",FALSE);
  42   1        bsp_lcd_display_str(2,36,"1.23",FALSE);
  43   1        bsp_lcd_display_str(2,83,"12.23",FALSE);
  44   1        //bsp_lcd_display_str(4,3,"6",FALSE);
  45   1        bsp_lcd_display_str(4,36,"12.34",FALSE);
  46   1        bsp_lcd_display_str(4,86,"00:00",FALSE);
  47   1        //bsp_lcd_display_str(6,1,"1>",FALSE);
  48   1        //bsp_lcd_display_str(6,15,"12.23",FALSE);
  49   1        //bsp_lcd_display_str(6,56,"12.3",FALSE);
  50   1        //bsp_lcd_display_str(6,102,"30",FALSE);
  51   1      //  bsp_lcd_display_16x16(0,0,0,UNDERLINE,FALSE);//电
  52   1      //  bsp_lcd_display_16x16(0,12,1,UNDERLINE,FALSE);//压
  53   1      //  //bsp_lcd_display_str(0,23,"12.3V",TRUE);
  54   1      //  bsp_lcd_display_16x16(0,61,3,UNDERLINE,FALSE);//容
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 2   

  55   1      //  bsp_lcd_display_16x16(0,73,4,UNDERLINE,FALSE);//量
  56   1      //  //bsp_lcd_display_str(0,85,"4.56AH",FALSE);
  57   1      //  bsp_lcd_display_16x16(2,0,0,UNDERLINE,FALSE);//电
  58   1      //  bsp_lcd_display_16x16(2,12,2,UNDERLINE,FALSE);//流
  59   1      //  //bsp_lcd_display_str(2,23,"50.0A",FALSE);
  60   1      //  bsp_lcd_display_16x16(2,61,0,UNDERLINE,FALSE);//电
  61   1      //  bsp_lcd_display_16x16(2,73,4,UNDERLINE,FALSE);//量
  62   1      //  //bsp_lcd_display_str(2,85,"7.89WH",FALSE);
  63   1      //  bsp_lcd_display_16x16(4,0,5,UNDERLINE,FALSE);//模
  64   1      //  bsp_lcd_display_16x16(4,12,6,UNDERLINE,FALSE);//式
  65   1      //  //bsp_lcd_display_16x16(4,36,13,UNDERLINE,TRUE);//一
  66   1      //  bsp_lcd_display_16x16(4,61,7,UNDERLINE,FALSE);//状
  67   1      //  bsp_lcd_display_16x16(4,73,8,UNDERLINE,FALSE);//态
  68   1      //  //bsp_lcd_display_16x16(4,92,19,NONUNDERLINE,FALSE);//充
  69   1      //  //bsp_lcd_display_16x16(4,104,0,NONUNDERLINE,FALSE);//电
  70   1      //  bsp_lcd_display_16x16(6,0,11,UNDERLINE,FALSE);//强
  71   1      //  bsp_lcd_display_16x16(6,12,12,UNDERLINE,FALSE);//度
  72   1      //  //bsp_lcd_display_str(6,24," 60%",FALSE);
  73   1      //  bsp_lcd_display_16x16(6,61,9,UNDERLINE,FALSE);//时
  74   1      //  bsp_lcd_display_16x16(6,73,10,UNDERLINE,FALSE);//间
  75   1      //  //bsp_lcd_display_str(6,89,"12:14",FALSE);
  76   1      //  bsp_lcd_draw_vline(59,0,7); 
  77   1      //  bsp_lcd_display_ascii(6,103,':',FALSE);
  78   1      }
  79          static u8 get_str_len(char* buf)
  80          {
  81   1        u8 result = 0;
  82   1        while(*(buf+result)){
  83   2          result++;
  84   2        }
  85   1        return result;
  86   1      }
  87          void menu_init(void)
  88          {
  89   1      }
  90          void show_battery_count(u8 count,bit reserve)
  91          {
  92   1        char buf[2];
  93   1        sprintf(buf,"%bd",count);
  94   1        buf[1]=0;
  95   1        bsp_lcd_display_str(4,3,buf,reserve);
  96   1      }
  97          void show_action_menu(u8 menu_index,u8 submenu_index,u8 actionresult)
  98          {
  99   1        char showbuf[22]={0};
 100   1        switch(menu_index)
 101   1        {
 102   2          case PARAM_SETTING_MENU:
 103   2            break;
 104   2          case OFFSET_MENU:
 105   2            if(submenu_index == 0)
 106   2            {
 107   3              bsp_lcd_clear_line(2,7);//擦除下面3行
 108   3              bsp_lcd_display_str_without_underline(2,0,"Zero point correction",FALSE);
 109   3              if(actionresult == 0){
 110   4                bsp_lcd_display_str_without_underline(4,0,"Waiting...",FALSE);
 111   4              }else{
 112   4                bsp_lcd_display_str_without_underline(4,0,"Done",FALSE);
 113   4                bsp_lcd_display_str_without_underline(6,0,"Press ENTER to back.",FALSE);
 114   4              }
 115   3            }else if(submenu_index == 1){//总电压
 116   3              bsp_lcd_clear_line(2,7);//擦除下面3行
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 3   

 117   3              bsp_lcd_display_str_without_underline(2,0,"Voltage correction",FALSE);
 118   3              bsp_lcd_display_str_without_underline(4,0,"Raw data:        V",FALSE);
 119   3              bsp_lcd_display_str_without_underline(6,0,"Adj data:        V",FALSE);        
 120   3            }else if(submenu_index == 2){//总电流
 121   3              bsp_lcd_clear_line(2,7);//擦除下面3行
 122   3              bsp_lcd_display_str_without_underline(2,0,"Current correction",FALSE);
 123   3              bsp_lcd_display_str_without_underline(4,0,"Raw data:        A",FALSE);
 124   3              bsp_lcd_display_str_without_underline(6,0,"Adj data:        A",FALSE);        
 125   3            }else{
 126   3              bsp_lcd_clear_line(2,7);//擦除下面3行
 127   3              if((submenu_index % 2) == 1){
 128   4                sprintf(showbuf,"CH%d VOL correction",((int)submenu_index-1)/2);
 129   4                bsp_lcd_display_str_without_underline(2,0,showbuf,FALSE);
 130   4                bsp_lcd_display_str_without_underline(4,0,"Raw data:        V",FALSE);
 131   4                bsp_lcd_display_str_without_underline(6,0,"Adj data:        V",FALSE);
 132   4              }else{
 133   4                sprintf(showbuf,"CH%d TEMP correction",((int)submenu_index-1)/2);
 134   4                bsp_lcd_display_str_without_underline(2,0,showbuf,FALSE);
 135   4                bsp_lcd_display_str_without_underline(4,0,"Raw data:        ",FALSE);
 136   4                bsp_lcd_diplay_unit_without_underline(4,102,1,FALSE);
 137   4                bsp_lcd_display_str_without_underline(6,0,"Adj data:        ",FALSE); 
 138   4                bsp_lcd_diplay_unit_without_underline(6,102,1,FALSE);           
 139   4              }
 140   3            }
 141   2            break;
 142   2        }
 143   1      }
 144          void show_param_setting_menu(void)
 145          {
 146   1        bsp_lcd_clear(0);
 147   1        bsp_lcd_draw_hline(1,0,127);
 148   1        bsp_lcd_display_str(0,37,"PARAM SET",FALSE);
 149   1      }
 150          void show_offset_menu(u8 sub_menu_index)
 151          {
 152   1        bsp_lcd_clear(0);
 153   1        bsp_lcd_draw_hline(1,0,127);
 154   1        bsp_lcd_display_str(0,25,"OFFSET ADJUST",FALSE);
 155   1        if(sub_menu_index < 3)
 156   1        {
 157   2          bsp_lcd_display_str_without_underline(2,1,"ZERO ADJ",FALSE);
 158   2          if(sub_menu_index == 0)
 159   2            bsp_lcd_display_str_without_underline(2,70,"GO",TRUE);
 160   2          else
 161   2            bsp_lcd_display_str_without_underline(2,70,"GO",FALSE);
 162   2          bsp_lcd_display_str_without_underline(4,1,"VOL ADJ",FALSE);
 163   2          if(sub_menu_index == 1)
 164   2            bsp_lcd_display_str_without_underline(4,70,"GO",TRUE);
 165   2          else
 166   2            bsp_lcd_display_str_without_underline(4,70,"GO",FALSE);
 167   2          bsp_lcd_display_str_without_underline(6,1,"CUR ADJ",FALSE);
 168   2          if(sub_menu_index == 2)
 169   2            bsp_lcd_display_str_without_underline(6,70,"GO",TRUE);
 170   2          else
 171   2            bsp_lcd_display_str_without_underline(6,70,"GO",FALSE);
 172   2        }
 173   1        else if(sub_menu_index < 9)
 174   1        {
 175   2          bsp_lcd_display_str_without_underline(2,1,"CH1:  VOL",FALSE);
 176   2          if(sub_menu_index == 3)
 177   2            bsp_lcd_display_str_without_underline(2,58,"GO",TRUE);
 178   2          else
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 4   

 179   2            bsp_lcd_display_str_without_underline(2,58,"GO",FALSE);
 180   2          bsp_lcd_display_str_without_underline(2,78,"TEMP",FALSE);
 181   2          if(sub_menu_index == 4)
 182   2            bsp_lcd_display_str_without_underline(2,108,"GO",TRUE);
 183   2          else
 184   2            bsp_lcd_display_str_without_underline(2,108,"GO",FALSE);
 185   2          bsp_lcd_display_str_without_underline(4,1,"CH2:  VOL",FALSE);
 186   2          if(sub_menu_index == 5)
 187   2            bsp_lcd_display_str_without_underline(4,58,"GO",TRUE);
 188   2          else
 189   2            bsp_lcd_display_str_without_underline(4,58,"GO",FALSE);
 190   2          bsp_lcd_display_str_without_underline(4,78,"TEMP",FALSE);
 191   2          if(sub_menu_index == 6)
 192   2            bsp_lcd_display_str_without_underline(4,108,"GO",TRUE);
 193   2          else
 194   2            bsp_lcd_display_str_without_underline(4,108,"GO",FALSE);  
 195   2          bsp_lcd_display_str_without_underline(6,1,"CH3:  VOL",FALSE);
 196   2          if(sub_menu_index == 7)
 197   2            bsp_lcd_display_str_without_underline(6,58,"GO",TRUE);
 198   2          else
 199   2            bsp_lcd_display_str_without_underline(6,58,"GO",FALSE);
 200   2          bsp_lcd_display_str_without_underline(6,78,"TEMP",FALSE);
 201   2          if(sub_menu_index == 8)
 202   2            bsp_lcd_display_str_without_underline(6,108,"GO",TRUE);
 203   2          else
 204   2            bsp_lcd_display_str_without_underline(6,108,"GO",FALSE);      
 205   2        }
 206   1        else
 207   1        {
 208   2          bsp_lcd_display_str_without_underline(2,1,"CH4:  VOL",FALSE);
 209   2          if(sub_menu_index == 9)
 210   2            bsp_lcd_display_str_without_underline(2,58,"GO",TRUE);
 211   2          else
 212   2            bsp_lcd_display_str_without_underline(2,58,"GO",FALSE);
 213   2          bsp_lcd_display_str_without_underline(2,78,"TEMP",FALSE);
 214   2          if(sub_menu_index == 10)
 215   2            bsp_lcd_display_str_without_underline(2,108,"GO",TRUE);
 216   2          else
 217   2            bsp_lcd_display_str_without_underline(2,108,"GO",FALSE);
 218   2          bsp_lcd_display_str_without_underline(4,1,"CH5:  VOL",FALSE);
 219   2          if(sub_menu_index == 11)
 220   2            bsp_lcd_display_str_without_underline(4,58,"GO",TRUE);
 221   2          else
 222   2            bsp_lcd_display_str_without_underline(4,58,"GO",FALSE);
 223   2          bsp_lcd_display_str_without_underline(4,78,"TEMP",FALSE);
 224   2          if(sub_menu_index == 12)
 225   2            bsp_lcd_display_str_without_underline(4,108,"GO",TRUE);
 226   2          else
 227   2            bsp_lcd_display_str_without_underline(4,108,"GO",FALSE);  
 228   2          bsp_lcd_display_str_without_underline(6,1,"CH6:  VOL",FALSE);
 229   2          if(sub_menu_index == 13)
 230   2            bsp_lcd_display_str_without_underline(6,58,"GO",TRUE);
 231   2          else
 232   2            bsp_lcd_display_str_without_underline(6,58,"GO",FALSE);
 233   2          bsp_lcd_display_str_without_underline(6,78,"TEMP",FALSE);
 234   2          if(sub_menu_index == 14)
 235   2            bsp_lcd_display_str_without_underline(6,108,"GO",TRUE);
 236   2          else
 237   2            bsp_lcd_display_str_without_underline(6,108,"GO",FALSE);      
 238   2        }
 239   1      }
 240          u8 show_next_setting_menu(void)
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 5   

 241          {
 242   1        
 243   1        cur_setting_index++;
 244   1        if(cur_setting_index>OFFSET_MENU)
 245   1          cur_setting_index = MAIN_MENU;
 246   1        switch(cur_setting_index)
 247   1        {
 248   2          case MAIN_MENU:
 249   2      //      bsp_lcd_display_16x16(0,0,21,UNDERLINE,FALSE);//0行0列，“上”，带下划线，不反色
 250   2      //      bsp_lcd_display_16x16(0,12,23,UNDERLINE,FALSE);//0行12列，“限”，带下划线，不反色
 251   2            show_main_menu();
 252   2          break;
 253   2          case PARAM_SETTING_MENU:
 254   2            
 255   2            show_param_setting_menu();
 256   2      
 257   2          break;
 258   2          case OFFSET_MENU:
 259   2            show_offset_menu(0);
 260   2      ////      bsp_lcd_display_16x16(0,0,29,UNDERLINE,FALSE);//0行0列，“校”，带下划线，不反色
 261   2      ////      bsp_lcd_display_16x16(0,12,30,UNDERLINE,FALSE);//0行12列，“准”，带下划线，不反色
 262   2            break;
 263   2          default:  
 264   2          break;
 265   2        }
 266   1        return cur_setting_index;
 267   1      }
 268          void show_channel_value(u8 ch_index,float vol_value,float ir_value,int temp_value,bit reverse)
 269          {
 270   1        char buf[10]={0};
 271   1        sprintf(buf,"%d>",(int)(ch_index+1));
 272   1        bsp_lcd_display_str(6,1,buf,reverse);
 273   1        if(vol_value < 9.995f)
 274   1          sprintf(buf," %0.2f",vol_value);
 275   1        else if(vol_value < 99.995f)
 276   1          sprintf(buf,"%0.2f",vol_value);
 277   1        else
 278   1          sprintf(buf,"%0.1f",vol_value);
 279   1        bsp_lcd_display_str(6,15,buf,reverse);
 280   1        if(ir_value < 9.995f){
 281   2          sprintf(buf,"%0.2f",ir_value);
 282   2          bsp_lcd_display_str(6,80,"m",FALSE);
 283   2        }else if(ir_value < 99.95f){
 284   2          sprintf(buf,"%0.1f",ir_value);
 285   2          bsp_lcd_display_str(6,80,"m",FALSE);
 286   2        }else if(ir_value <999.5f){
 287   2          sprintf(buf,"%d",((int)(ir_value+0.5f)));
 288   2          bsp_lcd_display_str(6,80,"m",FALSE);
 289   2        }else{
 290   2          bsp_lcd_display_str(6,80," ",FALSE);
 291   2          sprintf(buf,"0.2f",ir_value/1000);
 292   2          
 293   2        }
 294   1        bsp_lcd_display_str(6,56,buf,FALSE);
 295   1        if(temp_value < -50){
 296   2          sprintf(buf,"---");
 297   2        }else if(temp_value <=-10){
 298   2          sprintf(buf,"%d",temp_value);
 299   2        }else if(temp_value <0){
 300   2          sprintf(buf," %d",temp_value);
 301   2        }else if(temp_value<10){
 302   2          sprintf(buf,"  %d",temp_value);
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 6   

 303   2        }else if( temp_value <100){
 304   2          sprintf(buf," %d",temp_value);
 305   2        }else{
 306   2          sprintf(buf,"%d",temp_value);
 307   2        }
 308   1        buf[3]=0;
 309   1        buf[4]=0;
 310   1        bsp_lcd_display_str(6,96,buf,FALSE);  
 311   1      }
 312          //void show_vol_setting(float svalue)
 313          //{
 314          //  char showbuf[7];
 315          
 316          //  if(svalue < 10)
 317          //    sprintf(showbuf," %0.2f",svalue);
 318          //  else
 319          //    sprintf(showbuf,"%0.2f",svalue);
 320          //  
 321          //  showbuf[5]='\0';
 322          //  bsp_lcd_display_str(0,23,showbuf,TRUE);
 323          //}
 324          void show_vol_value_with_yx(u8 row,u8 startcol,u8 endcol,float value,bit reverse,bit underline)
 325          {
 326   1        char showbuf[10];
 327   1        u8 strlen = 0;
 328   1        u8 newstartcol=0;
 329   1        bsp_lcd_clear_span(row,startcol,endcol,FALSE);
 330   1        bsp_lcd_clear_span(row+1,startcol,endcol,underline);
 331   1        if(value<99.95f && value > -99.95f)
 332   1          sprintf(showbuf,"%0.2f",value);
 333   1        else
 334   1          sprintf(showbuf,"%0.1f",value);
 335   1        strlen=get_str_len(showbuf);
 336   1        newstartcol = (endcol - startcol - strlen*6) /2 + startcol +1;
 337   1        if(underline)
 338   1          bsp_lcd_display_str(row,newstartcol,showbuf,reverse);
 339   1        else
 340   1          bsp_lcd_display_str_without_underline(row,newstartcol,showbuf,reverse);
 341   1      }
 342          void show_vol_value(float value,bit reverse)
 343          {
 344   1        show_vol_value_with_yx(0,VLINE1_START+1,66,value,reverse,1);
 345   1      }
 346          void show_cur_value(float value,bit reverse)
 347          {
 348   1        char showbuf[6];
 349   1        if(value>=9.995f && value<99.95f)
 350   1          sprintf(showbuf,"%0.1f",value);
 351   1        else if(value < 9.995f)
 352   1          sprintf(showbuf,"%0.2f",value);
 353   1        else
 354   1          sprintf(showbuf," %d",(int)(value+0.5f));
 355   1        bsp_lcd_display_str(2,1,showbuf,reverse);
 356   1        
 357   1      }
 358          void show_mode_value(u8 mode_index,bit reverse)
 359          {
 360   1        cur_mode_index = mode_index;
 361   1        bsp_lcd_display_str(0,4,"    ",FALSE);
 362   1        bsp_lcd_display_str(0,4,modelist[cur_mode_index],reverse);
 363   1      }
 364          void show_cap_value(float value,bit reverse)
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 7   

 365          {
 366   1        char showbuf[8];
 367   1        u8 strlen=0;
 368   1        u8 endcol=0,startcol;
 369   1        if(value>=999.995f && value < 10000.0f){
 370   2          sprintf(showbuf,"%0.1f",(value+0.05f));
 371   2          bsp_lcd_display_str(0,109," ",reverse);
 372   2          endcol = 115;
 373   2        }else if(value < 999.995f){
 374   2          sprintf(showbuf,"%0.2f",value);
 375   2          bsp_lcd_display_str(0,109," ",reverse);
 376   2          endcol=115;
 377   2        }else{
 378   2          sprintf(showbuf,"%0.3f",(value/1000.0f));
 379   2          bsp_lcd_display_str(0,109,"K",reverse);
 380   2          endcol=109;
 381   2        }
 382   1        strlen = get_str_len(showbuf);
 383   1        startcol = (endcol - VLINE2_START - strlen*6) /2 + VLINE2_START + 1;
 384   1        bsp_lcd_display_str(0,startcol,showbuf,reverse);  
 385   1      }
 386          void show_power_value(float value,bit reverse)
 387          {
 388   1        char showbuf[8];
 389   1        if(value<9.995f){
 390   2          sprintf(showbuf," %0.2f",value);
 391   2        }else if(value < 99.995f){
 392   2          sprintf(showbuf,"%0.2f",value);
 393   2        }else if(value < 999.5f){
 394   2          sprintf(showbuf,"%0.1f",value);
 395   2        }else{
 396   2          sprintf(showbuf,"%0.1fK",value/1000);
 397   2        }
 398   1        bsp_lcd_display_str(2,36,showbuf,reverse);
 399   1      }
 400          void show_qe_value(float value,bit reverse)
 401          {
 402   1        char showbuf[8];
 403   1        if(value>=10.0f && value<100.0f)
 404   1          sprintf(showbuf,"%0.1fWH",(value+0.05f));
 405   1        else if(value < 10.0f)
 406   1          sprintf(showbuf,"%0.2fWH",value);
 407   1        else if(value >=100.0f && value < 1000.0f)
 408   1          sprintf(showbuf," %dWH",(int)(value+0.5f));
 409   1        else if(value >= 1000.0f && value < 10000.0f)
 410   1          sprintf(showbuf,"%dWH",(int)(value+0.5f));
 411   1        else
 412   1          sprintf(showbuf,"%0.1fKWH",(value/1000.0f));
 413   1        bsp_lcd_display_str(2,85,showbuf,reverse);
 414   1      }
 415          void show_status_value(u8 status_index,bit reverse)
 416          {
 417   1        cur_status_index = status_index;
 418   1        bsp_lcd_display_16x16(4,92,statuslist[status_index*2],NONUNDERLINE,reverse);//充
 419   1        bsp_lcd_display_16x16(4,104,statuslist[status_index*2+1],NONUNDERLINE,reverse);//电 
 420   1      }
 421          
 422          void show_time_value(u16 minutes,bit reverse)
 423          {
 424   1        static u8 curhour=0xff;
 425   1        static u8 curmin = 0xff;
 426   1        static bit lastreverse=0;
C51 COMPILER V9.56.0.0   MENU                                                              09/09/2024 20:46:02 PAGE 8   

 427   1        char showbuf[3];
 428   1        u8 hour,min;
 429   1        hour=(u8)(minutes / 60);
 430   1        min=(u8)(minutes % 60);
 431   1        if(curhour != hour || lastreverse != reverse)
 432   1        {
 433   2          curhour = hour;
 434   2          sprintf(showbuf,"%02bd",curhour);
 435   2          bsp_lcd_display_str(4,86,showbuf,reverse);
 436   2        }
 437   1        if(curmin != min || lastreverse != reverse)
 438   1        {
 439   2          curmin = min;
 440   2          sprintf(showbuf,"%02bd",curmin);
 441   2          bsp_lcd_display_str(4,104,showbuf,reverse);
 442   2        }
 443   1        lastreverse = reverse;
 444   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   4089    ----
   CONSTANT SIZE    =    594    ----
   XDATA SIZE       =      5     129
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      1      12
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
