📄 timer.lst
字号:
227 3 write_timer(&curr_time);
228 3 curr_time.hour=0, curr_time.minute=0;
229 3 read_timer(&curr_time);//zl.d
230 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
231 3 write_timer(&curr_time);
232 3 curr_time.hour=0, curr_time.minute=0;
233 3 read_timer(&curr_time);//zl.d
234 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
235 3 write_timer(&curr_time);
236 3 curr_time.hour=0, curr_time.minute=0;
237 3 read_timer(&curr_time);//zl.d
238 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
239 3 write_timer(&curr_time);
240 3 curr_time.hour=0, curr_time.minute=0;
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 5
241 3 read_timer(&curr_time);//zl.d
242 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
243 3 write_timer(&curr_time);
244 3 curr_time.hour=0, curr_time.minute=0;
245 3 read_timer(&curr_time);//zl.d
246 3 printf("curr_time.hour, curr_time.minute==%bx%bx\n",curr_time.hour, curr_time.minute);
247 3 write_timer(&curr_time);
248 3 read_timer(&curr_time);//zl.d
249 3
250 3 */
251 3
252 3
253 3 read_timer(0x01,&curr_time);//zl.d
254 3
255 3 init_timer_menu();
256 3 osd_clear(0xd0);osd_clear(0xdd);
257 3 //===load time from timer.===================
258 3
259 3
260 3 current_time_menu(curr_time.hour, curr_time.minute,curr_time.second);
261 3 //===load time from EEPROM .================
262 3 shi_sub_read(EEPROM, 0x20, 0, &on_time.hour);
263 3 shi_sub_read(EEPROM, 0x21, 0, &on_time.minute);
264 3 shi_sub_read(EEPROM, 0x22, 0, &off_time.hour);
265 3 shi_sub_read(EEPROM, 0x23, 0, &off_time.minute);
266 3 shi_sub_read(EEPROM, 0x24, 0, &timer_able_flag);
267 3 on_time_menu(on_time.hour,on_time.minute);
268 3 off_time_menu(off_time.hour,off_time.minute);
269 3 able_time_menu(timer_able_flag);
270 3 //===================================
271 3 timeshow_flag=1;
272 3 osd_hbsection(content,hl,0x13,0x14,0x02,0x02);
273 3 osd_color(content,background,highlight,Yellow);
274 3 }
275 2 //=====load timer value on time.
276 2
277 2 }
278 1 /////////////////////////////////////////////////////////////////zl.d
279 1 if(timemenu_flag)
280 1 {
281 2 read_timer(0x01,&curr_time);//zl.d
282 2
283 2 current_time_menu(curr_time.hour, curr_time.minute,curr_time.second);
284 2
285 2
286 2 }
287 1 ////////////////////////////////////////////////////////////////////
288 1
289 1 if(timemenu_flag&&(irdown_flag||irup_flag))
290 1 {
291 2 osd_timer=0;
292 2 if(irup_flag){
293 3 irup_flag=0;
294 3 time_sel--;
295 3 if(time_sel==0){
296 4 osd_timer=0;
297 4 DelayXms(0xff);osd_timer=0;DelayXms(0xff); osd_timer=0;
298 4 osd_show(00, 11, &NULLC);
299 4 //osd_show(0xd0, 0x10, &NULLC);osd_show(0xe0, 0x10, &NULLC);osd_show(0xf0, 0x08, &NULLC);
300 4 osd_clear(0x30);osd_clear(0x40);osd_clear(0x50);osd_clear(0x30);osd_clear(0x60);
301 4 osd_clear(0x70);osd_clear(0x80);osd_clear(0x90);osd_clear(0xa0);osd_clear(0xb0);
302 4 osd_clear(0xc0);osd_clear(0xd0);osd_clear(0xe0);osd_clear(0xf0);
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 6
303 4 if(mute_flag){
304 5 osd_size(content, 0, 0);
305 5 }
306 4 irup_flag=1;topmenu_flag=1;osd_timer=0;TR0=1;
307 4 time_sel=1;
308 4
309 4 timemenu_flag=0;
310 4 timeshow_flag=0;
311 4
312 4 inittopmenu();
313 4 initsubmenu1();
314 4 Submenu1(britc_sel);
315 4
316 4 osd_timer=0;
317 4 osd_switch(7);
318 4 }
319 3 }
320 2 else if(irdown_flag){
321 3 irdown_flag=0;
322 3 time_sel++;
323 3 if(time_sel==10){time_sel=9;}
324 3 }
325 2 #if _debug
326 2 printf("time_sel=%bx\n",time_sel);
327 2 #endif
328 2 osd_timer=0;
329 2 switch(time_sel){
330 3 case 1:
331 3 osd_hbsection(content,hl,0x13,0x14,0x02,0x02);
332 3 osd_color(content,background,highlight,Yellow);
333 3 osd_timer=0;
334 3 break;
335 3 case 2:
336 3 osd_hbsection(content,hl,0x16,0x17,0x02,0x02);
337 3 osd_color(content,background,highlight,Yellow);
338 3 osd_timer=0;
339 3 break;
340 3 case 3:
341 3 osd_hbsection(content,hl,0x13,0x14,0x03,0x03);
342 3 osd_color(content,background,highlight,Yellow);
343 3 break;
344 3 case 4:
345 3 osd_hbsection(content,hl,0x16,0x17,0x03,0x03);
346 3 osd_color(content,background,highlight,Yellow);
347 3 osd_timer=0;
348 3 break;
349 3 case 5:
350 3 osd_hbsection(content,hl,0x1a,0x20,0x03,0x03);
351 3 osd_color(content,background,highlight,Yellow);
352 3 osd_timer=0;
353 3 break;
354 3 case 6:
355 3 osd_hbsection(content,hl,0x13,0x14,0x04,0x04);
356 3 osd_color(content,background,highlight,Yellow);
357 3 osd_timer=0;
358 3 break;
359 3 case 7:
360 3 osd_hbsection(content,hl,0x16,0x17,0x04,0x04);
361 3 osd_color(content,background,highlight,Yellow);
362 3 osd_timer=0;
363 3 break;
364 3 case 8:
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 7
365 3 osd_hbsection(content,hl,0x1a,0x20,0x04,0x04);
366 3 osd_color(content,background,highlight,Yellow);
367 3 osd_timer=0;
368 3 break;
369 3 case 9:
370 3 osd_hbsection(content,hl,0x00,0x04,0x05,0x05);
371 3 osd_color(content,background,highlight,Yellow);
372 3 osd_timer=0;
373 3
374 3 DelayXms(0xff);osd_timer=0;DelayXms(0xff); osd_timer=0;
375 3 osd_show(00, 11, &NULLC);
376 3 //osd_show(0xd0, 0x10, &NULLC);osd_show(0xe0, 0x10, &NULLC);osd_show(0xf0, 0x08, &NULLC);
377 3 osd_clear(0x30);osd_clear(0x40);osd_clear(0x50);osd_clear(0x30);osd_clear(0x60);
378 3 osd_clear(0x70);osd_clear(0x80);osd_clear(0x90);osd_clear(0xa0);osd_clear(0xb0);
379 3 osd_clear(0xc0);osd_clear(0xd0);osd_clear(0xe0);osd_clear(0xf0);
380 3 if(mute_flag){
381 4 osd_size(content, 0, 0);
382 4 }
383 3 top_sel=7;
384 3 time_sel=1;
385 3 topmenu_flag=1;
386 3 britmenu_flag = 0;
387 3
388 3 timemenu_flag=0;
389 3 timeshow_flag=0;
390 3 volshow_flag = 0;
391 3 exit_flag=0;
392 3
393 3 inittopmenu();
394 3 osd_hbsection(content,hl,0x01,0x10,0x07,0x07);
395 3 osd_color(content,background,highlight,Yellow);
396 3 osd_timer=0;
397 3 TR0=1;
398 3 osd_switch(7);
399 3 break;
400 3 default:
401 3 osd_timer=0;
402 3 break;
403 3 }
404 2 osd_timer=0;
405 2 }
406 1
407 1 if(timemenu_flag&&irleft_flag){
408 2 irleft_flag=0;
409 2 switch (time_sel){
410 3 case 1:
411 3 read_timer(0x01,&curr_time);
412 3 if(curr_time.hour==0){
413 4 curr_time.hour=24;
414 4 }
415 3
416 3 curr_time.hour--;
417 3 printf("curr_time.minute%bx",curr_time.minute);
418 3 current_time_menu(curr_time.hour, curr_time.minute,curr_time.second);
419 3
420 3 //temp[0]=curr_time.hour;
421 3
422 3 //curr_time.hour=temp[0];
423 3 write_timer(0x01,&curr_time);
424 3
425 3
426 3
C51 COMPILER V7.50 TIMER 01/14/2006 15:30:04 PAGE 8
427 3 //shi_sub_read1(0x66, 0x02, &temp);
428 3 //printf("temp%bx\n",temp[1]);
429 3 //shi_sub_write1(0x66, 0x00, &curr_time.hour);
430 3 //write to timer chip
431 3
432 3 break;
433 3 case 2:
434 3 read_timer(0x01,&curr_time);
435 3 if(curr_time.minute==0){
436 4 curr_time.minute=60;
437 4 }
438 3
439 3 curr_time.minute--;
440 3 current_time_menu(curr_time.hour, curr_time.minute,curr_time.second);
441 3 //write to timer chip
442 3
443 3 //temp[1]=curr_time.minute;
444 3 //read_timer(&curr_time);
445 3 //curr_time.minute=temp[1];
446 3 write_timer(0x01,&curr_time);
447 3 break;
448 3 case 3:
449 3 //on_time.hour=12;on_time.minute=4;
450 3 //temp[0]=1;temp[2]=2;temp[3]=3;
451 3 //shi_sub_write1(0x68, 0x02, &temp);
452 3 //write_timer(0x02, &on_time);
453 3 //shi_sub_read1(0x68, 0x02,&temp);
454 3 //printf("w%bxh%bx%m%bx",temp[0],temp[1],temp[2]);
455 3 read_timer(0x02,&on_time);
456 3 if(on_time.hour==0){
457 4 on_time.hour=24;
458 4 }
459 3 on_time.hour--;
460 3 on_time_menu(on_time.hour, on_time.minute);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -