📄 at980.lst
字号:
__start:
__text_start:
01FE E5CF LDI R28,0x5F
01FF E0D4 LDI R29,4
0200 BFCD OUT P3D,R28
0201 BFDE OUT P3E,R29
0202 54C0 SUBI R28,0x40
0203 40D0 SBCI R29,0
0204 EA0A LDI R16,0xAA
0205 8308 STD R16,0+Y
0206 2400 CLR R0
0207 E9E2 LDI R30,0x92
0208 E0F1 LDI R31,1
0209 E012 LDI R17,2
020A 3BE1 CPI R30,0xB1
020B 07F1 CPC R31,R17
020C F011 BEQ 0x020F
020D 9201 ST R0,Z+
020E CFFB RJMP 0x020A
020F 8300 STD R16,0+Z
0210 ECEA LDI R30,0xCA
0211 E0F2 LDI R31,2
0212 E6A0 LDI R26,0x60
0213 E0B0 LDI R27,0
0214 E013 LDI R17,3
0215 3FEC CPI R30,0xFC
0216 07F1 CPC R31,R17
0217 F021 BEQ 0x021C
0218 95C8 LPM
0219 9631 ADIW R30,1
021A 920D ST R0,X+
021B CFF9 RJMP 0x0215
021C 940E08E6 CALL _main
_exit:
021E CFFF RJMP _exit
FILE: D:\avrmcu\AT980\AT980\vfd.c
(0000) #include "..\main.h"
(0001) #include "..\io.h"
(0002) #include <iom163.h>
(0003) #ifdef SGJM_RDS
(0004) #include "..\bu1923\bu1923.h"
(0005) #endif
(0006) #define VFD_BUFFER_SIZE 12
(0007) unsigned int g_vfd_grid_buffer[VFD_BUFFER_SIZE];
(0008) #ifdef MORE_THAN_16SEGMENT
(0009) unsigned char g_vfd_grid_ext_buffer[VFD_BUFFER_SIZE];
(0010) #endif
(0011) extern unsigned char display_type,work_mode,led_val;
(0012) extern unsigned int key_buff;
(0013) unsigned int g_ui_timing_cnt;
(0014)
(0015) #define VFD_LED_MIN 0x0001
(0016) #define VFD_LED_M 0x0002
(0017) #define VFD_LED_SEC 0x0004
(0018) #define VFD_LED_CH 0x0008
(0019) #define VFD_LED_DB 0x0010
(0020) #define VFD_LED_AUTO 0x0020
(0021) #define VFD_LED_CINEMA 0x4000 //cinema dsp
(0022) #define VFD_LED_SLEEP 0x8000
(0023)
(0024) #define VFD_LED_PLUS 0x4000
(0025) #define VFD_LED_SUB 0x8000
(0026) #define VFD_LED_KHZ 0x4000
(0027) #define VFD_LED_MHZ 0x8000
(0028) #define VFD_LED_COL 0x4000
(0029) #define VFD_LED_DP 0x8000
(0030) #define VFD_LED_MEMORY 0x4000
(0031) #define VFD_LED_FM 0x4000
(0032) #define VFD_LED_AM 0x8000
(0033) #define VFD_LED_MUTE 0x4000
(0034) #define VFD_LED_STEREO 0x4000
(0035) #define VFD_LED_TAPE2 0x4000
(0036) #define VFD_LED_SURROUND 0x0001
(0037) #define VFD_LED_EQ 0x0002
(0038) #define VFD_LED_MIC 0x0004
(0039) #define VFD_LED_PRO 0x0008
(0040) #define VFD_LED_DOLBY 0x0010
(0041) #define VFD_LED_AC3 0x0020
(0042) #define VFD_LED_SRS 0x0040
(0043) #define VFD_LED_KEYCON 0x0080
(0044)
(0045) #define VA 0x0001
(0046) #define VB 0x0002
(0047) #define VH 0x0004
(0048) #define VJ 0x0008
(0049) #define VK 0x0010
(0050) #define VF 0x0020
(0051) #define VG 0x0040
(0052) #define VM 0x0080
(0053) #define VC 0x0100
(0054) #define VN 0x0200
(0055) #define VP 0x0400
(0056) #define VR 0x0800
(0057) #define VE 0x1000
(0058) #define VD 0x2000
(0059)
(0060) #define VFD_digit_zero VA|VB|VC|VD|VE|VF
(0061) #define VFD_digit_one VB|VC
(0062) #define VFD_digit_two VA|VB|VG|VM|VE|VD
(0063) #define VFD_digit_three VA|VB|VC|VD|VG|VM
(0064) #define VFD_digit_four VF|VG|VB|VC|VM
(0065) #define VFD_digit_five VA|VF|VG|VC|VD|VM
(0066) #define VFD_digit_six VA|VF|VG|VC|VD|VE|VM
(0067) #define VFD_digit_seven VA|VB|VC
(0068) #define VFD_digit_eight VA|VB|VC|VD|VE|VF|VG|VM
(0069) #define VFD_digit_nine VA|VB|VC|VD|VF|VG|VM
(0070)
(0071)
(0072) /* VFD Alphabetic Characters */
(0073)
(0074) #define VFD_alpha_A VA|VB|VC|VF|VE|VG|VM
(0075) #define VFD_alpha_B VF|VG|VE|VD|VC|VM
(0076) #define VFD_alpha_C VA|VF|VE|VD
(0077) #define VFD_alpha_D VB|VG|VE|VD|VC|VM
(0078) #define VFD_alpha_E VA|VF|VE|VG|VD|VM
(0079) #define VFD_alpha_F VA|VF|VG|VE|VM
(0080) #define VFD_alpha_G VA|VF|VE|VD|VC|VM
(0081) #define VFD_alpha_H VF|VE|VB|VC|VG|VM
(0082) #define VFD_alpha_I VJ|VP
(0083) #define VFD_alpha_J 0x0000
(0084) #define VFD_alpha_K VJ|VP|VK|VN
(0085) #define VFD_alpha_L VF|VE|VD
(0086) #define VFD_alpha_M VB|VC|VE|VF|VH|VK
(0087) #define VFD_alpha_N VF|VE|VH|VN|VB|VC
(0088) #define VFD_alpha_O VA|VB|VC|VD|VE|VF
(0089) #define VFD_alpha_P VA|VB|VG|VF|VE|VM
(0090) #define VFD_alpha_R VA|VB|VG|VF|VE|VM|VN
(0091) #define VFD_alpha_S VA|VF|VG|VC|VD|VM
(0092) #define VFD_alpha_T VA|VJ|VP
(0093) #define VFD_alpha_U VF|VE|VD|VC|VB
(0094) #define VFD_alpha_V VF|VE|VR|VK
(0095) #define VFD_alpha_W VF|VE|VR|VN|VC|VB
(0096) #define VFD_alpha_X VH|VK|VR|VN
(0097) #define VFD_alpha_Y VH|VK|VP
(0098) #define VFD_alpha_Z VA|VK|VR|VD
(0099)
(0100) #define VFD_alpha_aster VH|VJ|VK|VG|VM|VR|VP|VN
(0101) #define VFD_alpha_DASH VD
(0102) #define VFD_alpha_MINUS VG|VM
(0103) #define VFD_alpha_PLUS VJ|VP|VG|VM
(0104)
(0105)
(0106) #define LA 0x0080
(0107) #define LB 0x0100
(0108) #define LC 0x0800
(0109) #define LD 0x2000
(0110) #define LE 0x1000
(0111) #define LF 0x0200
(0112) #define LG 0x0400
(0113)
(0114) #define RA 0x0001
(0115) #define RB 0x0002
(0116) #define RC 0x0010
(0117) #define RD 0x0040
(0118) #define RE 0x0020
(0119) #define RF 0x0004
(0120) #define RG 0x0008
(0121)
(0122) #define VFD_digit_right_zero RA|RB|RC|RD|RE|RF
(0123) #define VFD_digit_right_one RB|RC
(0124) #define VFD_digit_right_two RA|RB|RG|RE|RD
(0125) #define VFD_digit_right_three RA|RB|RC|RD|RG
(0126) #define VFD_digit_right_four RF|RG|RB|RC
(0127) #define VFD_digit_right_five RA|RF|RG|RC|RD
(0128) #define VFD_digit_right_six RA|RF|RG|RC|RD|RE
(0129) #define VFD_digit_right_seven RA|RB|RC
(0130) #define VFD_digit_right_eight RA|RB|RC|RD|RE|RF|RG
(0131) #define VFD_digit_right_nine RA|RB|RC|RD|RF|RG
(0132)
(0133) #define VFD_digit_left_zero LA|LB|LC|LD|LE|LF
(0134) #define VFD_digit_left_one LB|LC
(0135) #define VFD_digit_left_two LA|LB|LG|LE|LD
(0136) #define VFD_digit_left_three LA|LB|LC|LD|LG
(0137) #define VFD_digit_left_four LF|LG|LB|LC
(0138) #define VFD_digit_left_five LA|LF|LG|LC|LD
(0139) #define VFD_digit_left_six LA|LF|LG|LC|LD|LE
(0140) #define VFD_digit_left_seven LA|LB|LC
(0141) #define VFD_digit_left_eight LA|LB|LC|LD|LE|LF|LG
(0142) #define VFD_digit_left_nine LA|LB|LC|LD|LF|LG
(0143)
(0144)
(0145) #define MAX_LETTER 8
(0146)
(0147) #define G1 0x00
(0148) #define G2 0x01
(0149) #define G3 0x02
(0150) #define G4 0x03
(0151) #define G5 0x04
(0152) #define G6 0x05
(0153) #define G7 0x06
(0154) #define G8 0x07
(0155) #define G9 0x08
(0156) #define G10 0x09
(0157) #define G11 0x0a
(0158)
(0159) const static unsigned int num_xlate[10] =
(0160) {
(0161) VFD_digit_zero,
(0162) VFD_digit_one,
(0163) VFD_digit_two,
(0164) VFD_digit_three,
(0165) VFD_digit_four,
(0166) VFD_digit_five,
(0167) VFD_digit_six,
(0168) VFD_digit_seven,
(0169) VFD_digit_eight,
(0170) VFD_digit_nine
(0171) };
(0172) const static unsigned int num_xlate_left[10] = {
(0173) VFD_digit_left_zero,
(0174) VFD_digit_left_one,
(0175) VFD_digit_left_two,
(0176) VFD_digit_left_three,
(0177) VFD_digit_left_four,
(0178) VFD_digit_left_five,
(0179) VFD_digit_left_six,
(0180) VFD_digit_left_seven,
(0181) VFD_digit_left_eight,
(0182) VFD_digit_left_nine
(0183) };
(0184)
(0185) const static unsigned num_xlate_right[10] = {
(0186) VFD_digit_right_zero,
(0187) VFD_digit_right_one,
(0188) VFD_digit_right_two,
(0189) VFD_digit_right_three,
(0190) VFD_digit_right_four,
(0191) VFD_digit_right_five,
(0192) VFD_digit_right_six,
(0193) VFD_digit_right_seven,
(0194) VFD_digit_right_eight,
(0195) VFD_digit_right_nine
(0196) };
(0197)
(0198)
(0199)
(0200) const static unsigned int vfd_alpha[] = {
(0201) VFD_alpha_A,
(0202) VFD_alpha_B,
(0203) VFD_alpha_C,
(0204) VFD_alpha_D,
(0205) VFD_alpha_E,
(0206) VFD_alpha_F,
(0207) VFD_alpha_G,
(0208) VFD_alpha_H,
(0209) VFD_alpha_I,
(0210) VFD_alpha_J,
(0211) VFD_alpha_K,
(0212) VFD_alpha_L,
(0213) VFD_alpha_M,
(0214) VFD_alpha_N,
(0215) VFD_alpha_O,
(0216) VFD_alpha_P,
(0217) 0x0000,
(0218) VFD_alpha_R,
(0219) VFD_alpha_S,
(0220) VFD_alpha_T,
(0221) VFD_alpha_U,
(0222) VFD_alpha_V,
(0223) VFD_alpha_W,
(0224) VFD_alpha_X,
(0225) VFD_alpha_Y,
(0226) VFD_alpha_Z,
(0227) };
(0228) unsigned char Set_String(unsigned char *str);
(0229) extern unsigned char Mchvol,Bassvol,Treblevol,Balanceval,Loudnessval;
(0230) unsigned char *err_msg,blink_time;
(0231) extern unsigned int radio_count,freq;
(0232) extern unsigned char is_autosearching;
(0233) extern unsigned char amfm_flag,g_ui_tmp_msg_cnt,station_no;
(0234) #ifdef SGJM_RDS
(0235) extern unsigned char rds_status;
(0236) extern unsigned char pty_is_searching;
(0237) extern unsigned char rds_dis_buffer[65];
(0238) extern unsigned char rds_dis_string[65];
(0239) extern unsigned char rds_display_type;
(0240) #endif
(0241) extern unsigned char muted;
(0242) unsigned int info;
(0243) extern unsigned char hm_flag,time_val[];
(0244) unsigned int num_trans(unsigned char num)
(0245) {
(0246) return num_xlate[num];
_num_trans:
num --> R16
021F E882 LDI R24,0x82
0220 E091 LDI R25,1
0221 2FE0 MOV R30,R16
0222 27FF CLR R31
0223 940E1AB6 CALL 0x1AB6
0225 9105 LD R16,R16
0226 9114 LD R17,R17
0227 9508 RET
_display_digit:
r2 --> R20
r --> R22
num --> R10
0228 940E1A10 CALL push_gset3
022A 0158 MOVW R10,R16
(0247) }
(0248) void display_digit(unsigned int num)
(0249) {
(0250) unsigned char r,r2;
(0251) r = 2;
022B E062 LDI R22,2
(0252) do
(0253) {
(0254) r2 = num%10;
022C E02A LDI R18,0xA
022D E030 LDI R19,0
022E 0185 MOVW R16,R10
022F 940E1982 CALL mod16u
0231 01A8 MOVW R20,R16
(0255) num /= 10;
0232 E02A LDI R18,0xA
0233 E030 LDI R19,0
0234 0185 MOVW R16,R10
0235 940E1984 CALL div16u
0237 0158 MOVW R10,R16
(0256) g_vfd_grid_buffer[r] = num_trans(r2);
0238 2F04 MOV R16,R20
0239 DFE5 RCALL _num_trans
023A 0118 MOVW R2,R16
023B E989 LDI R24,0x99
023C E091 LDI R25,1
023D 2FE6 MOV R30,R22
023E 27FF CLR R31
023F 940E1AB6 CALL 0x1AB6
0241 8220 STD R2,0+Z
0242 8231 STD R3,1+Z
(0257) r++;
0243 9563 INC R22
(0258) }while(num);
0244 20AA TST R10
0245 F731 BNE 0x022C
0246 20BB TST R11
0247 F721 BNE 0x022C
(0259) }
0248 940E1A1B CALL pop_gset3
024A 9508 RET
_tuner_display:
r --> R22
r2 --> R20
024B 940E1A0C CALL push_gset2
(0260)
(0261) void tuner_display(void)
(0262) {
(0263)
(0264) unsigned char r,r2;
(0265)
(0266) switch(display_type)
024D 91400140 LDS R20,0x140
024F 2755 CLR R21
0250 3040 CPI R20,0
0251 E0E0 LDI R30,0
0252 075E CPC R21,R30
0253 F40C BGE 0x0255
0254 C176 RJMP 0x03CB
0255 940E1C4F CALL 0x1C4F
0257 F034 BLT 0x025E
0258 E488 LDI R24,0x48
0259 E090 LDI R25,0
025A 01FA MOVW R30,R20
025B 940E1AA8 CALL <created procedures>
025D 9409 IJMP
025E 304E CPI R20,0xE
025F E0E0 LDI R30,0
0260 075E CPC R21,R30
0261 F409 BNE 0x0263
0262 C151 RJMP 0x03B4
0263 304F CPI R20,0xF
0264 E0E0 LDI R30,0
0265 075E CPC R21,R30
0266 F009 BEQ 0x0268
0267 C163 RJMP 0x03CB
(0267) {
(0268)
(0269) case DISPLAY_DIGIT:
(0270)
(0271) if(blink_time<3)
0268 91800194 LDS R24,_blink_time
026A 3083 CPI R24,3
026B F008 BCS 0x026D
026C C15E RJMP 0x03CB
(0272) display_digit(radio_count);
026D 940E1B7B CALL 0x1B7B
026F DFB8 RCALL _display_digit
(0273) break;
0270 C15A RJMP 0x03CB
(0274)
(0275) case DIS_FREQUENCY:
(0276)
(0277) display_digit(freq);
0271 940E1B54 CALL 0x1B54
0273 DFB4 RCALL _display_digit
(0278) if(g_ui_tmp_msg_cnt)
0274 90200147 LDS R2,0x147
0276 2022 TST R2
0277 F0A9 BEQ 0x028D
(0279) {
(0280) r = station_no;
0278 916001B8 LDS R22,_station_no
(0281) r++;
027A 9563 INC R22
027B 940E1CAF CALL 0x1CAF
(0282) r2 =r/10;
(0283) g_vfd_grid_buffer[9] = num_trans(r2);
027D DFA1 RCALL _num_trans
027E 0118 MOVW R2,R16
027F 923001AC STS R3,0x1AC
0281 922001AB STS R2,0x1AB
0283 940E1D22 CALL 0x1D22
(0284) r2 =r%10;
0285 2F40 MOV R20,R16
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -