📄 fireplace.lst
字号:
240
241 <01> disable_base_time
242
243 ;initial base timer
244 010D E6 DC A2 LD BTCON,#0a2H ;disable watchdog timer ,Fxx/4096
245 ;Basic timer input clock=fxx/16
246 <01> .endm
247
248 <01> init_port
249
250 ;ld p0conl,#10101001b ;p0.0 uart input,other_output
251 0110 E6 E7 B4 ld p0conl,#10110100b
252
253 0113 E6 E6 AA ld p0conh,#10101010b
254
255 0116 E6 E0 00 ld P0,#00h
256
257 0119 E6 E1 FF ld p1,#0ffh
258
259 011C E6 E8 08 ld p0pnd,#00001000b ;INT1 falling edge interrupt enable
260
261 011F E6 E9 0A ld p1con,#00001010b ;clock_circuit,reset_circuit
262
263 0122 E6 EB AA ld p2conl,#10101010b ;led_scan_output: p2.0-3 output
264 0125 E6 EA 4F ld p2conh,#01001111b ;led_scan_output: p2.0-3 output
265
266 0128 E6 E2 FF ld p2,#0ffH
267
268 <01> .endm
269
270 ;*************************************
271 012B clear_ram:
272
273 012B 0C BF LD R0,#0BFH
274
275 012D clear_ram1:
276
277 012D 00 C0 DEC R0
278 012F D6 C0 00 LD @R0,#00H
279 0132 EB F9 JR NZ,clear_ram1
280
281
282
283
284
285 ;************************************
286
287 ;EI
288
289 ;enable_base_time
290
291 ;**************************************
292 ;initial_ram:
293 0134 E6 10 00 ld fire_status,#00h
294 0137 E6 11 00 ld temp_status,#00h
295 013A E6 1B 01 ld led_display_flag,#01H
296
297 013D 56 E2 BF and p2,#10111111B ;motor=p2.6 disenble motor
298 ;or p0,#00001000B ;set p0.3 disenble spker
299 0140 56 E0 F7 and p0,#11110111B
300
301 0143 E6 24 01 ld beep_flag,#01h
302 0146 E6 65 01 ld AD_convert_time,#01h
303
304 0149 F6 01 AD CALL wait_1S
305 014C F6 0A 39 call restore
306
307 014F 9F EI
308
309 <01> enable_base_time
310
311 ;initial base timer
312 0150 E6 DC B2 LD BTCON,#0b2H ;enable watchdog timer ,Fxx/4096
313 ;Basic timer input clock=fxx/16
314 <01> .endm
315 ;*************************************************
316
317 0153 main:
318 0153 46 DC 02 OR BTCON,#02h ;clear watchdog
319
320 0156 F6 05 D4 CALL led_scan
321 0159 F6 05 D4 CALL led_scan
322 015C F6 05 D4 CALL led_scan
323 015F F6 05 D4 CALL led_scan
324 0162 F6 05 D4 CALL led_scan
325 0165 F6 05 D4 CALL led_scan
326
327 0168 F6 06 82 CALL key_scan
328
329 016B F6 05 D4 CALL led_scan
330 016E F6 05 D4 CALL led_scan
331 0171 F6 05 D4 CALL led_scan
332 0174 F6 05 D4 CALL led_scan
333 0177 F6 05 D4 CALL led_scan
334 017A F6 05 D4 CALL led_scan
335
336 017D F6 0B 78 call motor_change
337
338
339 0180 F6 05 D4 CALL led_scan
340 0183 F6 05 D4 CALL led_scan
341 0186 F6 05 D4 CALL led_scan
342 0189 F6 05 D4 CALL led_scan
343 018C F6 05 D4 CALL led_scan
344 018F F6 05 D4 CALL led_scan
345
346 0192 F6 0A 75 call AD_judge
347
348 0195 F6 05 D4 CALL led_scan
349 0198 F6 05 D4 CALL led_scan
350 019B F6 05 D4 CALL led_scan
351 019E F6 05 D4 CALL led_scan
352 01A1 F6 05 D4 CALL led_scan
353 01A4 F6 05 D4 CALL led_scan
354
355 01A7 F6 02 E6 call remote_deal_program
356
357 01AA 8D 01 53 jp main
358
359 ;*******************************************************************
360 01AD wait_1S:
361 01AD 0C FF LD R0,#0FFH
362 01AF 1C FF LD R1,#0FFH
363 01B1 2C 05 LD R2,#05H
364 01B3 wait_1:
365 01B3 00 C0 DEC R0
366 01B5 ED 01 B3 JP NZ,wait_1
367 01B8 00 C1 DEC R1
368 01BA ED 01 B3 JP NZ,wait_1
369 01BD 00 C2 DEC R2
370 01BF ED 01 B3 JP NZ,wait_1
371 01C2 AF RET
372 ;*************************Interrupt Vector***************************
373 01C3 int_vec:
374
375 01C3 76 D2 01 TM T0CON,#01H
376 01C6 ED 01 D0 JP NZ,time0_program
377
378 01C9 76 E8 04 TM P0PND,#04H
379 01CC ED 02 07 JP nz,remote_program
380
381 01CF int_vec_end:
382
383 01CF BF IRET
384
385 ;******************************************************************
386
387 ;********************************************
388 01D0 time0_program:
389
390 01D0 70 D5 push flags
391
392
393 01D2 76 24 01 tm beep_flag,#01h
394 01D5 6B 0D jr z,counter_program
395
396 01D7 beep_program:
397 01D7 76 E0 40 tm p0,#01000000B ;beep=p0.6
398 01DA 6B 05 jr z,beep_set
399 01DC 56 E0 BF and p0,#10111111B
400 01DF 8B 03 jr counter_program
401 01E1 beep_set:
402 01E1 46 E0 40 or p0,#01000000B
403
404 01E4 counter_program:
405 01E4 20 25 inc common_counter
406 01E6 A6 25 0A cp common_counter,#10
407 01E9 7B 09 jr ult,time0_program1
408 01EB E6 25 00 ld common_counter,#0
409 01EE E6 26 01 ld common_flag,#01h
410
411 01F1 F6 05 11 call counter_check
412
413
414 01F4 time0_program1:
415
416 01F4 20 30 inc remote_pulse_time
417 01F6 A6 30 8F cp remote_pulse_time,#143 ;90
418 ;cp remote_pulse_time,#220 ;90
419
420 01F9 EB 06 jr ne,time_program_end
421 01FB E6 30 00 ld remote_pulse_time,#0
422 01FE E6 31 00 ld remote_flag,#0
423
424
425
426 0201 time_program_end:
427 0201 50 D5 pop flags
428 0203 56 D2 FE AND T0CON,#0feh
429
430 0206 BF IRET
431
432 ;**********************************************
433 ;**********************************************
434 0207 remote_program:
435
436 0207 70 C0 push r0
437 0209 70 C1 push r1
438
439 020B F6 02 16 call remote_receive_program
440
441
442 020E remote_int_program_end:
443
444
445 020E 50 C1 pop r1
446 0210 50 C0 pop r0
447 0212 56 E8 FB AND p0pnd,#0fbh
448
449 0215 BF IRET
450
451 ;*******************************************************************
452
453
454
455 ;*************************************
456 0216 remote_receive_program:
457
458 0216 08 30 ld r0,remote_pulse_time
459 0218 E6 30 00 ld remote_pulse_time,#0
460
461 021B 76 50 01 tm remote_repeat_start,#01h
462 021E EB 05 jr nz,remote_head_code
463
464 0220 76 31 01 tm remote_flag,#01h ;judge head_byte
465 0223 EB 5C jr nz,remote_data_program
466
467 0225 remote_head_code:
468
469 0225 A6 C0 8F cp r0,#143
470 ;cp r0,#220
471 0228 7B 0D jr ult,remote_head_data0 ;less 90
472 022A E6 32 00 ld remote_bit_num,#0
473 022D E6 33 00 ld remote_byte_num,#0
474 0230 E6 34 00 ld remote_data,#0
475 0233 56 31 FE and remote_flag,#0feh
476 0236 AF ret
477
478 0237 remote_head_data0:
479
480 0237 A6 C0 46 cp r0,#70
481 ;cp r0,#190
482 023A BB 0D jr ugt,remote_head_data1 ;more 90
483 023C E6 32 00 ld remote_bit_num,#0
484 023F E6 33 00 ld remote_byte_num,#0
485 0242 E6 34 00 ld remote_data,#0
486 0245 56 31 FE and remote_flag,#0feh
487 0248 AF ret
488
489 0249 remote_head_data1:
490
491 0249 46 31 01 or remote_flag,#01h
492 024C E6 32 00 ld remote_bit_num,#0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -