📄 menuinterface.lst
字号:
198 2 voice_call(ptr);
199 2 break;
200 2
201 2 case 1:
202 2 voice_hold_on();
203 2 break;
204 2
205 2 case 2:
206 2 voice_hold_off();
207 2 break;
208 2 }
209 1
210 1 return 0;
211 1 }
212
213 void set_bus_id(unsigned char *value)
214 {
215 1 memcpy(busInfo.busId, value, BUSID_LEN);
216 1 nf_configWrite(NF_BUSID_ID, value);
217 1 // nf_configWriteAll();
218 1 }
219
220 extern xdata Byte* bufPoint[4];
221 /**************************************
222 *nLineNum:值从1开始
223 *不能有cs来支持
224 *返回值:2成功;1U盘数据有错误
225 **************************************/
226 Uint16 readserial_toflash(Byte nLineNum)
227 {
228 1 Uint32 flashPage, nTotalSpace, nCurRead;
229 1 Uint16 nTmp;
230 1 Byte i;
231 1 Byte nValue;
232 1 //停止播放
233 1 stop_board();
234 1 read_deviceid();
235 1 nf_wp_off();
236 1 flashPage = 1024*(nLineNum-1);//1024页,每页用480/512存6条数据
237 1 nValue = 0;
238 1
239 1 spi_cson();
C51 COMPILER V7.09 MENUINTERFACE 09/17/2008 16:38:56 PAGE 5
*** WARNING C206 IN LINE 239 OF MAIN\MENUINTERFACE.C: 'spi_cson': missing function-prototype
240 1 command_low_conread(0, 0);
241 1 nTotalSpace = 0;
242 1 nCurRead = 0;
243 1 /*****add by cj************/
244 1 for (nTmp=0; nTmp<1024; nTmp++)
245 1 {
246 2
247 2 for (i=0; i<4; i++)
248 2 {
249 3 at45_readdataout(128, bufPoint[i]);
250 3 /* if (nTmp < 400)
251 3 {
252 3 if (KO == check_buf_allff(bufPoint[i], 128))
253 3 return 1;
254 3 }*/
255 3 }
256 2 if (0 == nValue)
257 2 {
258 3 nValue = 1;
259 3 if ((bufPoint[0][0] != 0x55) || (bufPoint[0][1] != 0xaa))
260 3 return 1;
261 3 nTotalSpace = bufPoint[0][0x17]+bufPoint[0][0x18]*0x100+bufPoint[0][0x19]*0x10000;
262 3 }
263 2 nf_write_onepage2(flashPage, bufPoint[0], bufPoint[1], bufPoint[2], bufPoint[3]);
264 2 flashPage++;
265 2 nCurRead += 512;
266 2 if (nCurRead >= nTotalSpace)
267 2 break;
268 2 }
269 1 nf_wp_on();
270 1 spi_csoff();
*** WARNING C206 IN LINE 270 OF MAIN\MENUINTERFACE.C: 'spi_csoff': missing function-prototype
271 1 return nTmp;
272 1 }
273
274 /************************************************8
275 *将USB上的内容下载到终端上进行程序升级
276 *假定前面512字节为文件头
277 *type: 3表示主机程序,2表示终端程序
278 ***********************************************/
279 #define SIZE_PROGRAMHEADER 512
280 #define SIZE_PROGRAM 65536
281
282 #define SIZE_CHECKALL 0xe000
283 /**********************************************
284 *一旦有返回值都表示出错
285 *2:表示成功,永远不会返回该值;1:U盘类型不对;3:U盘数据故障
286 **********************************************/
287 Byte readserial_to_termProgram(Byte type)
288 {
289 1 /* Uint32 readSize;
290 1 Byte nValue, nTmp;
291 1
292 1 nValue = 0;
293 1 nTmp = 0;
294 1 readSize = 0;
295 1
296 1 command_low_conread(0, 0);
297 1
298 1 while (1)
299 1 {
C51 COMPILER V7.09 MENUINTERFACE 09/17/2008 16:38:56 PAGE 6
300 1 at45_readdataout(128, bufPoint[0]);
301 1 readSize += 128;
302 1 if (nTmp == 1)
303 1 {
304 1 if (KO == check_buf_zero(bufPoint[0], 128))
305 1 return 3;
306 1 if (readSize < SIZE_CHECKALL)
307 1 {
308 1 if (KO == check_buf_allff(bufPoint[0], 128))
309 1 return 3;
310 1 }
311 1 //将读到的内容下到E2中
312 1 if (readSize > SIZE_PROGRAM)
313 1 //最后一个包
314 1 update_firmware(0, 4, bufPoint[0]);
315 1 else
316 1 update_firmware(0, 1, bufPoint[0]);
317 1 delayMs(10);
318 1 }
319 1 else
320 1 {
321 1 //
322 1 if (0 == nValue)
323 1 {
324 1 nValue = 1;
325 1 if ((bufPoint[0][0] != 0x55) || (bufPoint[0][1] != 0xaa) || (type != bufPoint[0][2]))
326 1 return 1;
327 1 }
328 1 if (readSize == SIZE_PROGRAMHEADER)
329 1 {
330 1 nTmp = 1;
331 1 readSize = 0;
332 1 }
333 1 }
334 1 }*/
335 1
336 1 return 2;
337 1 }
*** WARNING C280 IN LINE 287 OF MAIN\MENUINTERFACE.C: 'type': unreferenced local variable
338
339
340 void set_serverIp(unsigned char *ptr)
341 {
342 1 memcpy(systemInfo.ipAddr, ptr, IPADDR_LEN);
343 1
344 1 nf_configWrite(NF_IPADDR_ID, ptr);
345 1 // nf_configWriteAll();
346 1
347 1 }
348
349 BROAD_MODE get_board_mode()
350 {
351 1 return systemInfo.boardMode;
352 1 }
353
354 Byte get_buslineNum()
355 {
356 1 return busInfo.lineNum;
357 1 }
358
359 /***获取线路名称**********/
360 /*lineNum : 线路编号,值从0开始
C51 COMPILER V7.09 MENUINTERFACE 09/17/2008 16:38:56 PAGE 7
361 /***************************************/
362 Byte get_linenameBynum(Uint8 lineNum/*in*/, Byte* pName/*名称*/, Uint8 nLen/*输入时为buf的长度,输出时为名
-称实际长度*/)
363 {
364 1 Byte j;
365 1 if (nLen < MAX_LINENAME_SIZE)
366 1 j = nLen;
367 1 else
368 1 j = MAX_LINENAME_SIZE;
369 1
370 1 memcpy(pName, termPara.line[lineNum].lineName, j);
371 1 return OK;
372 1 }
373
374 void get_raw_termtime(Byte* pBuf)
375 {
376 1
377 1 *pBuf++ = systemInfo.hour;
378 1 *pBuf++ = systemInfo.min;
379 1 *pBuf++ = systemInfo.sec;
380 1 }
381
382 Byte get_menu_speed()
383 {
384 1 return systemInfo.speedHold;
385 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1279 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 47
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = 1 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 3 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -