📄 updateprogram.lst
字号:
C51 COMPILER V7.09 UPDATEPROGRAM 09/17/2008 16:04:29 PAGE 1
C51 COMPILER V7.09, COMPILATION OF MODULE UPDATEPROGRAM
OBJECT MODULE PLACED IN .\output\updateprogram.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main\updateprogram.c LARGE BROWSE INCDIR(audio\;eeprom\;extendUART\;flash\;
-gps\;inter\;key\;mcu\;menu\;usb\;gprs\;main\;1wire\) DEBUG OBJECTEXTEND PRINT(.\output\updateprogram.lst) OBJECT(.\outpu
-t\updateprogram.obj)
line level source
1 #include "typedef.h"
2 #include "updateprogram.h"
3 #include "global.h"
4 #include "nvram.h"
5 #include "mcuInit.h"
6 #include "common_function.h"
7 UPDATE_PROGTIME g_updatetime;
8 Uchar g_timecount = 2;
9 Uchar g_startReset = 0;
10 /***********************************
11 *pTime:需要更新的时间,这里采用压缩BCD进行编码,
12 ************************************/
13 void write_updatetime(Uchar *pTime)
14 {
15 1 g_updatetime.valid = UPDATE_VALID;
16 1 g_updatetime.year = bcd2bin(pTime[0]);
17 1 g_updatetime.mon = bcd2bin(pTime[1]);
18 1 g_updatetime.day = bcd2bin(pTime[2]);
19 1 g_updatetime.hour = bcd2bin(pTime[3]);
20 1 g_updatetime.min = bcd2bin(pTime[4]);
21 1 g_updatetime.sec = bcd2bin(pTime[5]);
22 1 nvram_write(NVRAM_UPDATE_TIME, &g_updatetime);
23 1 }
24
25 /********************************
26 *初始化更新时间,在主机启动后初始化调用
27 **********************************/
28 void init_updatetime()
29 {
30 1 nvram_read(NVRAM_UPDATE_TIME, &g_updatetime);
31 1 }
32
33 extern xdata SYSTEM_INFO systemInfo;
34 void start_updatehost()
35 {
36 1 g_updatetime.valid = UPDATE_INVALID;
37 1 nvram_write(NVRAM_UPDATE_TIME, &g_updatetime);
38 1 //生成通知包
39 1 // encapsulate_hostreset();
40 1 g_startReset = 1;
41 1 }
42 /********************************
43 *判断是否需要更新的进程,目前准备3秒测试一次
44 ********************************/
45 void process_updateprog()
46 {
47 1 if (g_startReset > 0)
48 1 {
49 2 switch_ld_ap();
50 2 }
51 1 if (UPDATE_VALID == g_updatetime.valid)
52 1 {
53 2 if (0 == g_timecount)
C51 COMPILER V7.09 UPDATEPROGRAM 09/17/2008 16:04:29 PAGE 2
54 2 {
55 3 g_timecount = 2;
56 3 if (systemInfo.year > g_updatetime.year)
57 3 {
58 4 //开始更新
59 4 start_updatehost();
60 4 }
61 3 else if (systemInfo.year == g_updatetime.year)
62 3 {
63 4 if (systemInfo.mon > g_updatetime.mon)
64 4 {
65 5 start_updatehost();
66 5 }
67 4 else if (systemInfo.mon == g_updatetime.mon)
68 4 {
69 5 if (systemInfo.day > g_updatetime.day)
70 5 {
71 6 start_updatehost();
72 6 }
73 5 else if (systemInfo.day == g_updatetime.day)
74 5 {
75 6 if (systemInfo.hour > g_updatetime.hour)
76 6 {
77 7 start_updatehost();
78 7 }
79 6 else if (systemInfo.hour == g_updatetime.hour)
80 6 {
81 7 if (systemInfo.min > g_updatetime.min)
82 7 {
83 8 start_updatehost();
84 8 }
85 7 else if (systemInfo.min == g_updatetime.min)
86 7 {
87 8 if (systemInfo.sec >= g_updatetime.sec)
88 8 start_updatehost();
89 8 }
90 7 }
91 6 }
92 5 }
93 4 }
94 3 }
95 2 else
96 2 g_timecount--;
97 2 }
98 1 else
99 1 g_startReset = 0;
100 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 436 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = 12 3
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -