📄 retime.lst
字号:
238 1 else if(cort==5) //第五次按下确认键
239 1 {
240 2 first_sure=0;
C51 COMPILER V8.02 RETIME 06/24/2007 13:22:44 PAGE 5
241 2 second_sure=0;
242 2 third_sure=0;
243 2 fourth_sure=0;
244 2 fifth_sure=1;
245 2 sixth_sure=0;
246 2 seventh_sure=0;
247 2
248 2 }
249 1 else if(cort==6) //第六次按下确认键
250 1 {
251 2
252 2 first_sure=0;
253 2 second_sure=0;
254 2 third_sure=0;
255 2 fourth_sure=0;
256 2 fifth_sure=0;
257 2 sixth_sure=1;
258 2 seventh_sure=0;
259 2
260 2 }
261 1 else if(cort==7) //第七次按下确认键
262 1 {
263 2 cort=0;
264 2 first_sure=0;
265 2 second_sure=0;
266 2 third_sure=0;
267 2 fourth_sure=0;
268 2 fifth_sure=0;
269 2 sixth_sure=0;
270 2 seventh_sure=1;
271 2 }
272 1
273 1 }
274 /*******************************
275 减一键子程序
276 *******************************/
277 void dec_key(void)
278 {
279 1 if(first_sure) //第一次按下确认键,小时位减
280 1 {
281 2 if(shi_num!=24)
282 2 {
283 3 ++shi_num;
284 3 if((--xiaoshi_ge)==255)
285 3 {
286 4 xiaoshi_ge=9;
287 4 if((--xiaoshi_shi)==255)
288 4 {
289 5 xiaoshi_shi=2;
290 5 xiaoshi_ge=3;
291 5 }
292 4 }
293 3 }
294 2 else if(shi_num==24)
295 2 {
296 3 shi_num=1;
297 3 xiaoshi_ge=3;
298 3 xiaoshi_shi=2;
299 3 }
300 2 }
301 1 else if(second_sure) //第二次按下确认键,分钟位减
302 1 {
C51 COMPILER V8.02 RETIME 06/24/2007 13:22:44 PAGE 6
303 2 if((--fenzhong_ge)==255)
304 2 {
305 3 fenzhong_ge=9;
306 3 if((--fenzhong_shi)==255)
307 3 {
308 4 fenzhong_shi=5;
309 4 }
310 3 }
311 2 }
312 1 else if(third_sure) //第三次按下确认键,年位减
313 1 {
314 2 if((--year_unitstore)==255)
315 2 {
316 3 year_unitstore=9;
317 3 if((--year_decastore)==255)
318 3 {
319 4 year_decastore=9;
320 4 if((--year_hundstore)==255)
321 4 {
322 5 year_hundstore=9;
323 5 if((--year_thoustore)==255)
324 5 {
325 6 year_thoustore=9;
326 6 }
327 5 }
328 4 }
329 3 }
330 2 }
331 1 else if(fourth_sure) //第四次按下确认键,月位减
332 1 {
333 2 if(month_num!=12)
334 2 {
335 3 ++month_num;
336 3 if((--month_unitstore)==255)
337 3 {
338 4 month_unitstore=9;
339 4 --month_decastore;
340 4 }
341 3 }
342 2 else if(month_num==12)
343 2 {
344 3 month_num=1;
345 3 month_unitstore=2;
346 3 month_decastore=1;
347 3 }
348 2 }
349 1 else if(fifth_sure) //第五次按下确认键,日位减
350 1 {
351 2 if((month_unitstore|0xfe)==0xff) //是奇数月,日为31天
352 2 {
353 3 if((day_numj)!=31)
354 3 {
355 4 ++day_numj;
356 4 if((--day_unitstore)==255)
357 4 {
358 5 day_unitstore=9;
359 5 --day_decastore;
360 5 }
361 4 }
362 3 else if(day_numj==31)
363 3 {
364 4 day_numj=1;
C51 COMPILER V8.02 RETIME 06/24/2007 13:22:44 PAGE 7
365 4 day_unitstore=1;
366 4 day_decastore=3;
367 4 }
368 3 }
369 2 else if((month_unitstore|0xfe)!=0xff) //是偶数月,日为30天
370 2 {
371 3
372 3 if(
373 3
374 3 month_unitstore==2) //是二月
375 3 {
376 4 if(day_numo!=day_numoo)
377 4 {
378 5 ++day_numo;
379 5 if((--day_unitstore)==255)
380 5 {
381 6 day_unitstore=9;
382 6 --day_decastore;
383 6 }
384 5 }
385 4
386 4 else if(day_numo==day_numoo)
387 4 {
388 5 if(day_numoo==28)
389 5 {
390 6 day_numo=1;
391 6 day_unitstore=8;
392 6 day_decastore=2;
393 6 }
394 5 else if(day_numoo==29)
395 5 {
396 6 day_numo=1;
397 6 day_unitstore=9;
398 6 day_decastore=2;
399 6 }
400 5
401 5 }
402 4 }
403 3 else if(month_unitstore!=2) //不是二月
404 3 {
405 4 if(day_numooo!=30)
406 4 {
407 5 ++day_numooo;
408 5 day_numo=day_numooo;
409 5 if((--day_unitstore)==255)
410 5 {
411 6 day_unitstore=9;
412 6 --day_decastore;
413 6 day_numo=day_numooo;
414 6 }
415 5 }
416 4 else if(day_numooo==30)
417 4 {
418 5
419 5 day_numooo=1;
420 5 day_unitstore=0;
421 5 day_decastore=3;
422 5 day_numo=day_numooo;
423 5
424 5 }
425 4 }
426 3 }
C51 COMPILER V8.02 RETIME 06/24/2007 13:22:44 PAGE 8
427 2 }
428 1 else if(sixth_sure) //第六次按下确认键,倒计时位减
429 1 {
430 2 if((--retime_ustore)==255)
431 2 {
432 3 retime_ustore=9;
433 3 if((--retime_dstore)==255)
434 3 {
435 4 retime_dstore=9;
436 4 if((--retime_hstore)==255)
437 4 {
438 5 retime_hstore=9;
439 5 if((--retime_tstore)==255)retime_tstore=9;
440 5 }
441 4 }
442 3 }
443 2 }
444 1 }
445 /*******************************
446
447 年位闪烁子程序
448
449 *******************************/
450 void year_flash(void)
451 {
452 1 unsigned char i;
453 1 if(third_sure)
454 1 {
455 2 year_thoustore=year_thousand;
456 2 year_hundstore=year_hundred;
457 2 year_decastore=year_decade;
458 2 year_unitstore=year_unit;
459 2 while(third_sure)
460 2 {
461 3 for(i=0;i<18;i++) //年位不显示,其它位都显示
462 3 {
463 4 year_thousand=10;
464 4 year_hundred=10;
465 4 year_decade=10;
466 4 year_unit=10;
467 4 fen_ge=fenzhong_ge;
468 4 fen_shi=fenzhong_shi;
469 4 display();
470 4 kbscan();
471 4 if(!third_sure)i=51; //如果不满足立即跳出
472 4 }
473 3 if(third_sure)
474 3 {
475 4 for(i=0;i<18;i++) //年位和其它位都显示
476 4 {
477 5 year_thousand=year_thoustore;
478 5 year_hundred=year_hundstore;
479 5 year_decade=year_decastore;
480 5 year_unit=year_unitstore;
481 5 fen_ge=fenzhong_ge;
482 5 fen_shi=fenzhong_shi;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -