⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nec_ir.lis

📁 sunplus spca514 cdmp3 源码
💻 LIS
📖 第 1 页 / 共 3 页
字号:
                         .module nec_ir.c
                         .area bss(ram, con, rel)
 0000                 L2:
 0000                   .blkb 2
                         .area text(rom, con, rel)
 0000                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0000                   .dbfunc s ir_get_timer _ir_get_timer fI
 0000                   .dbsym s old_ir_timer L2 i
                       ;             t2 -> R20,R21
                       ;             t1 -> R22,R23
                         .even
 0000                 _ir_get_timer::
 0000 0E940000          xcall push_gset2
 0004                   .dbline -1
 0004                   .dbline 45
                       ; /***********************************************************************/
                       ; /* File:                                                               */
                       ; /*    Copyright (c) 2000 ZORAN Corporation, All Rights Reserved        */
                       ; /*    THIS IS PROPRIETARY SOURCE CODE OF ZORAN CORPORATION             */
                       ; /*                                                                     */
                       ; /* ===========                                                         */
                       ; 
                       ; #include "iom163.h"
                       ; #define ir_rising()     TCCR1B |= 0x40
                       ; #define ir_falling()    TCCR1B &= 0xBF
                       ; //the time increment for gen_time is 1.00us
                       ; #define IR_MARGIN   300   //150
                       ; #define time_9000_us    9000/75
                       ; #define time_9000_ush   9900/75
                       ; #define time_9000_usl   8100/75
                       ; 
                       ; #define time_4500_us    4500/75
                       ; #define time_4500_ush   5100/75
                       ; #define time_4500_usl   3900/75
                       ; 
                       ; #define time_2250_us    2250/75
                       ; #define time_2250_ush   2550/75
                       ; #define time_2250_usl   1950/75
                       ; 
                       ; #define time_1125_us    1125/75
                       ; #define time_1125_ush   1275/75
                       ; #define time_1125_usl   975/75
                       ; #define G_IR_SYSTEM_CODE 0x00ff
                       ; 
                       ; // State of the remote key decoder
                       ; #define IDLE        0
                       ; #define LEADER_ON   1
                       ; #define LEADER_OFF  2
                       ; #define CUSTOM      3
                       ; #define DATA1       4
                       ; #define DATA2       5
                       ; 
                       ; // Hoe many repeat message will ignire before send it to the FSM's
                       ; #define REPEAT_DELAY    3
                       ; extern unsigned int key_buff,dvd_key;
                       ; 
                       ; 
                       ; /* TP0713, timer optimization */
                       ; unsigned char ir_get_timer(void)
                       ; {
 0004                   .dbline 48
                       ;    static  unsigned int old_ir_timer;
                       ;    unsigned int t1,t2;
                       ;    t1 = ICR1L;
 0004 66B5              in R22,0x26
 0006 7727              clr R23
 0008                   .dbline 49
                       ;    t1 |= (unsigned int)ICR1H<<8;
 0008 27B4              in R2,0x27
 000A 3324              clr R3
 000C 322C              mov R3,R2
 000E 2224              clr R2
 0010 6229              or R22,R2
 0012 7329              or R23,R3
 0014                   .dbline 50
                       ;    if(t1>old_ir_timer)
 0014 30900100          lds R3,L2+1
 0018 20900000          lds R2,L2
 001C 2616              cp R2,R22
 001E 3706              cpc R3,R23
 0020 20F4              brsh L3
 0022                   .dbline 51
                       ;     t2 = t1-old_ir_timer;
 0022 AB01              movw R20,R22
 0024 4219              sub R20,R2
 0026 5309              sbc R21,R3
 0028 0CC0              xjmp L4
 002A                 L3:
 002A                   .dbline 53
                       ;    else 
                       ;     t2 =(65535-old_ir_timer)+t1+1;
 002A 30900100          lds R3,L2+1
 002E 20900000          lds R2,L2
 0032 4FEF              ldi R20,-1
 0034 5FEF              ldi R21,-1
 0036 4219              sub R20,R2
 0038 5309              sbc R21,R3
 003A 460F              add R20,R22
 003C 571F              adc R21,R23
 003E 4F5F              subi R20,255  ; offset = 1
 0040 5F4F              sbci R21,255
 0042                 L4:
 0042                   .dbline 55
                       ;     
                       ;     old_ir_timer = t1;
 0042 70930100          sts L2+1,R23
 0046 60930000          sts L2,R22
 004A                   .dbline 56
                       ;     return (unsigned char)(t2/75);
 004A 2BE4              ldi R18,75
 004C 30E0              ldi R19,0
 004E 8A01              movw R16,R20
 0050 0E940000          xcall div16u
 0054 1127              clr R17
 0056                   .dbline -2
 0056                 L1:
 0056 0E940000          xcall pop_gset2
 005A                   .dbline 0 ; func end
 005A 0895              ret
 005C                   .dbsym r t2 20 i
 005C                   .dbsym r t1 22 i
                         .area vector(rom, abs)
                         .org 20
 0014 0C942E00          jmp _timer1_capt_isr
                         .area text(rom, con, rel)
 005C                   .dbfile D:\avrmcu\AT980\nec_ir.c
                         .area bss(ram, con, rel)
 0002                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0002                 L6:
 0002                   .blkb 1
                         .area data(ram, con, rel)
 0000                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0000                 L7:
 0000                   .blkb 1
                         .area idata
 0000 03                .byte 3
                         .area data(ram, con, rel)
 0001                   .dbfile D:\avrmcu\AT980\nec_ir.c
                         .area bss(ram, con, rel)
 0003                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0003                 L8:
 0003                   .blkb 2
                         .area data(ram, con, rel)
 0001                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0001                 L9:
 0001                   .blkb 1
                         .area idata
 0001 00                .byte 0
                         .area data(ram, con, rel)
 0002                   .dbfile D:\avrmcu\AT980\nec_ir.c
                         .area bss(ram, con, rel)
 0005                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0005                 L10:
 0005                   .blkb 1
 0006                 L11:
 0006                   .blkb 1
 0007                 L12:
 0007                   .blkb 1
                         .area data(ram, con, rel)
 0002                   .dbfile D:\avrmcu\AT980\nec_ir.c
 0002                 L13:
 0002                   .blkb 1
                         .area idata
 0002 00                .byte 0
                         .area data(ram, con, rel)
 0003                   .dbfile D:\avrmcu\AT980\nec_ir.c
                         .area text(rom, con, rel)
 005C                   .dbfile D:\avrmcu\AT980\nec_ir.c
 005C                   .dbfunc s timer1_capt_isr _timer1_capt_isr fI
                         .area func_lit(rom, con, rel)
 0000                 L57:
 0000 4E00              .word `L17
 0002 5500              .word `L18
 0004 6500              .word `L21
 0006 A200              .word `L32
 0008 E900              .word `L41
 000A 1C01              .word `L48
                         .area text(rom, con, rel)
 005C                   .dbfile D:\avrmcu\AT980\nec_ir.c
 005C                   .dbsym s valid_repeat L13 c
 005C                   .dbsym s data2 L12 c
 005C                   .dbsym s data1 L11 c
 005C                   .dbsym s count L10 c
 005C                   .dbsym s state L9 c
 005C                   .dbsym s custom L8 i
 005C                   .dbsym s repeat_delay L7 c
 005C                   .dbsym s key L6 c
                       ;             t0 -> R20
                         .even
 005C                 _timer1_capt_isr::
 005C 0E940000          xcall push_lset
 0060 0E940000          xcall push_gset2
 0064                   .dbline -1
 0064                   .dbline 61
                       ; }
                       ; 
                       ; #pragma interrupt_handler timer1_capt_isr:6
                       ; void timer1_capt_isr(void)  //IR_IST
                       ; {
 0064                   .dbline 72
                       ;     static unsigned char key;                           // Hold the key code
                       ;     static unsigned char repeat_delay = REPEAT_DELAY;   // Repeat code counter
                       ;     static unsigned int  custom;                            // Hold the custom (remote ID) code
                       ;     static unsigned char state = 0;                     // State holder
                       ;     static unsigned char count;                         // bits counter
                       ;     static unsigned char data1, data2;                  // Temporary for holding the decoded data
                       ;     static unsigned char valid_repeat = 0;
                       ; 
                       ; 
                       ;     unsigned char t0;                               // Hold the last timer value
                       ;     t0 = ir_get_timer();
 0064 CDDF              xcall _ir_get_timer
 0066 1801              movw R2,R16
 0068 422D              mov R20,R2
 006A                   .dbline 74
 006A 60910100          lds R22,L9
 006E 7727              clr R23
 0070 6030              cpi R22,0
 0072 E0E0              ldi R30,0
 0074 7E07              cpc R23,R30
 0076 0CF4              brge X1
 0078 1DC1              xjmp L14
 007A                 X1:
 007A 85E0              ldi R24,5
 007C 90E0              ldi R25,0
 007E 8617              cp R24,R22
 0080 9707              cpc R25,R23
 0082 0CF4              brge X2
 0084 17C1              xjmp L14
 0086                 X2:
 0086 80E0              ldi R24,<L57
 0088 90E0              ldi R25,>L57
 008A FB01              movw R30,R22
 008C EE0F              lsl R30
 008E FF1F              rol R31
 0090 E80F              add R30,R24
 0092 F91F              adc R31,R25
 0094 0590              lpm R0,Z+
 0096 1490              lpm R1,Z
 0098 F001              movw R30,R0
 009A 0994              ijmp
 009C                 X0:
 009C                   .dbline 74
                       ;     
                       ;     switch (state) {
 009C                 L17:
 009C                   .dbline 76
                       ;     case IDLE:      
                       ;         ir_rising(); //ir_interrupt_set_edge(RISING_EDGE);
 009C 8EB5              in R24,0x2e

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -