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

📄 main.lst

📁 此程序为利用mage8 AVR 和EM4094实现读取TYPE B类型卡的C程序、读卡稳定、这个项目我们做了好久、非常不错的程序、很适合做这方面产品的朋友们参考
💻 LST
📖 第 1 页 / 共 5 页
字号:
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciWbaaa.s 			page 1


   1               		.file	"main.c"
   2               		.arch atmega8
   3               	__SREG__ = 0x3f
   4               	__SP_H__ = 0x3e
   5               	__SP_L__ = 0x3d
   6               	__tmp_reg__ = 0
   7               	__zero_reg__ = 1
   8               		.global __do_copy_data
   9               		.global __do_clear_bss
  10               		.stabs	"E:\\PROJECT_GCC\\ISO14443-B_OK/",100,0,0,.Ltext0
  11               		.stabs	"main.c",100,0,0,.Ltext0
  12               		.text
  13               	.Ltext0:
  14               		.stabs	"gcc2_compiled.",60,0,0,0
  15               		.stabs	"int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
  16               		.stabs	"char:t(0,2)=@s8;r(0,2);0;255;",128,0,0,0
  17               		.stabs	"long int:t(0,3)=@s32;r(0,3);0020000000000;0017777777777;",128,0,0,0
  18               		.stabs	"unsigned int:t(0,4)=r(0,4);0000000000000;0000000177777;",128,0,0,0
  19               		.stabs	"long unsigned int:t(0,5)=@s32;r(0,5);0000000000000;0037777777777;",128,0,0,0
  20               		.stabs	"long long int:t(0,6)=@s64;r(0,6);01000000000000000000000;0777777777777777777777;",128,0,0,
  21               		.stabs	"long long unsigned int:t(0,7)=@s64;r(0,7);0000000000000;01777777777777777777777;",128,0,0,
  22               		.stabs	"short int:t(0,8)=r(0,8);-32768;32767;",128,0,0,0
  23               		.stabs	"short unsigned int:t(0,9)=r(0,9);0000000000000;0000000177777;",128,0,0,0
  24               		.stabs	"signed char:t(0,10)=@s8;r(0,10);-128;127;",128,0,0,0
  25               		.stabs	"unsigned char:t(0,11)=@s8;r(0,11);0;255;",128,0,0,0
  26               		.stabs	"float:t(0,12)=r(0,1);4;0;",128,0,0,0
  27               		.stabs	"double:t(0,13)=r(0,1);4;0;",128,0,0,0
  28               		.stabs	"long double:t(0,14)=r(0,1);4;0;",128,0,0,0
  29               		.stabs	"complex int:t(0,15)=s4real:(0,1),0,16;imag:(0,1),16,16;;",128,0,0,0
  30               		.stabs	"complex float:t(0,16)=R3;8;0;",128,0,0,0
  31               		.stabs	"complex double:t(0,17)=R3;8;0;",128,0,0,0
  32               		.stabs	"complex long double:t(0,18)=R3;8;0;",128,0,0,0
  33               		.stabs	"__builtin_va_list:t(0,19)=*(0,20)=(0,20)",128,0,0,0
  34               		.stabs	"_Bool:t(0,21)=@s8;-16;",128,0,0,0
  35               		.stabs	"main.c",130,0,0,0
  36               		.stabs	"C:/WinAVR/avr/include/avr/io.h",130,0,0,0
  37               		.stabs	"C:/WinAVR/avr/include/avr/sfr_defs.h",130,0,0,0
  38               		.stabs	"C:/WinAVR/avr/include/inttypes.h",130,0,0,0
  39               		.stabs	"int8_t:t(4,1)=(0,10)",128,0,67,0
  40               		.stabs	"uint8_t:t(4,2)=(0,11)",128,0,72,0
  41               		.stabs	"int16_t:t(4,3)=(0,1)",128,0,90,0
  42               		.stabs	"uint16_t:t(4,4)=(0,4)",128,0,95,0
  43               		.stabs	"int32_t:t(4,5)=(0,3)",128,0,106,0
  44               		.stabs	"uint32_t:t(4,6)=(0,5)",128,0,111,0
  45               		.stabs	"int64_t:t(4,7)=(0,6)",128,0,124,0
  46               		.stabs	"uint64_t:t(4,8)=(0,7)",128,0,129,0
  47               		.stabs	"intptr_t:t(4,9)=(4,3)",128,0,141,0
  48               		.stabs	"uintptr_t:t(4,10)=(4,4)",128,0,146,0
  49               		.stabn	162,0,0,0
  50               		.stabn	162,0,0,0
  51               		.stabs	"C:/WinAVR/avr/include/avr/iom8.h",130,0,0,0
  52               		.stabn	162,0,0,0
  53               		.stabs	"C:/WinAVR/avr/include/avr/portpins.h",130,0,0,0
  54               		.stabn	162,0,0,0
  55               		.stabn	162,0,0,0
  56               		.stabs	"C:/WinAVR/avr/include/avr/interrupt.h",130,0,0,0
  57               		.stabn	162,0,0,0
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciWbaaa.s 			page 2


  58               		.stabs	"C:/WinAVR/avr/include/avr/signal.h",130,0,0,0
  59               		.stabn	162,0,0,0
  60               		.stabs	"C:/WinAVR/avr/include/avr/wdt.h",130,0,0,0
  61               		.stabn	162,0,0,0
  62               		.stabs	"C:/WinAVR/avr/include/avr/eeprom.h",130,0,0,0
  63               		.stabs	"C:/WinAVR/lib/gcc-lib/avr/3.3.2/include/stddef.h",130,0,0,0
  64               		.stabs	"size_t:t(11,1)=(0,4)",128,0,213,0
  65               		.stabn	162,0,0,0
  66               		.stabn	162,0,0,0
  67               		.stabs	"C:/WinAVR/avr/include/avr/pgmspace.h",130,0,0,0
  68               		.stabs	"C:/WinAVR/lib/gcc-lib/avr/3.3.2/include/stddef.h",130,0,0,0
  69               		.stabn	162,0,0,0
  70               		.stabs	"prog_void:t(12,1)=(12,2)=(12,2)",128,0,89,0
  71               		.stabs	"prog_char:t(12,3)=(12,4)=@s8;r(12,4);0;255;",128,0,90,0
  72               		.stabs	"prog_uchar:t(12,5)=(12,6)=@s8;r(12,6);0;255;",128,0,91,0
  73               		.stabs	"prog_int8_t:t(12,7)=(12,8)=(0,10)",128,0,93,0
  74               		.stabs	"prog_uint8_t:t(12,9)=(0,11)",128,0,94,0
  75               		.stabs	"prog_int16_t:t(12,10)=(12,11)=(0,1)",128,0,95,0
  76               		.stabs	"prog_uint16_t:t(12,12)=(12,13)=(0,4)",128,0,96,0
  77               		.stabs	"prog_int32_t:t(12,14)=(12,15)=(0,3)",128,0,98,0
  78               		.stabs	"prog_uint32_t:t(12,16)=(12,17)=(0,5)",128,0,99,0
  79               		.stabs	"prog_int64_t:t(12,18)=(12,19)=(0,6)",128,0,101,0
  80               		.stabs	"prog_uint64_t:t(12,20)=(12,21)=(0,7)",128,0,102,0
  81               		.stabn	162,0,0,0
  82               		.stabs	"level4.h",130,0,0,0
  83               		.stabn	162,0,0,0
  84               		.stabs	"level3.h",130,0,0,0
  85               		.stabn	162,0,0,0
  86               		.stabs	"level2.h",130,0,0,0
  87               		.stabn	162,0,0,0
  88               		.stabs	"level1.h",130,0,0,0
  89               		.stabn	162,0,0,0
  90               	.global	write_4094_low
  91               		.data
  92               		.type	write_4094_low, @object
  93               		.size	write_4094_low, 2
  94               	write_4094_low:
  95 0000 1F68      		.word	26655
  96               	.global	write_4094_hi
  97               		.type	write_4094_hi, @object
  98               		.size	write_4094_hi, 2
  99               	write_4094_hi:
 100 0002 6002      		.word	608
 101               	.global	cmd_message
 102               		.type	cmd_message, @object
 103               		.size	cmd_message, 5
 104               	cmd_message:
 105 0004 05        		.byte	5
 106 0005 00        		.byte	0
 107 0006 00        		.byte	0
 108 0007 71        		.byte	113
 109 0008 FF        		.byte	-1
 110               	.global	ID
 111               		.section	.eeprom,"aw",@progbits
 112               		.type	ID, @object
 113               		.size	ID, 1
 114               	ID:
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciWbaaa.s 			page 3


 115 0000 01        		.byte	1
 116               	.global	SERIAL_NUMBER
 117               		.type	SERIAL_NUMBER, @object
 118               		.size	SERIAL_NUMBER, 1
 119               	SERIAL_NUMBER:
 120 0001 FF        		.byte	-1
 121               	.global	WEIGAN_FORMAT
 122               		.type	WEIGAN_FORMAT, @object
 123               		.size	WEIGAN_FORMAT, 1
 124               	WEIGAN_FORMAT:
 125 0002 01        		.byte	1
 126               	.global	AUTH_CODE
 127               		.type	AUTH_CODE, @object
 128               		.size	AUTH_CODE, 1
 129               	AUTH_CODE:
 130 0003 00        		.byte	0
 131               	.global	EEPROM_CHECK
 132               		.type	EEPROM_CHECK, @object
 133               		.size	EEPROM_CHECK, 1
 134               	EEPROM_CHECK:
 135 0004 00        		.byte	0
 136               	.global	RESET_DEFAULT
 137               		.type	RESET_DEFAULT, @object
 138               		.size	RESET_DEFAULT, 1
 139               	RESET_DEFAULT:
 140 0005 00        		.byte	0
 141               	.global	ALARM_LEVEL
 142               		.type	ALARM_LEVEL, @object
 143               		.size	ALARM_LEVEL, 1
 144               	ALARM_LEVEL:
 145 0006 01        		.byte	1
 146               	.global	ALARM_TIME
 147               		.type	ALARM_TIME, @object
 148               		.size	ALARM_TIME, 1
 149               	ALARM_TIME:
 150 0007 05        		.byte	5
 151               	.global	ALARM_ENABLE
 152               		.type	ALARM_ENABLE, @object
 153               		.size	ALARM_ENABLE, 1
 154               	ALARM_ENABLE:
 155 0008 01        		.byte	1
 156               	.global	TYPE_B_SETTING
 157               		.type	TYPE_B_SETTING, @object
 158               		.size	TYPE_B_SETTING, 1
 159               	TYPE_B_SETTING:
 160 0009 01        		.byte	1
 161               	.global	ID_CHK
 162               		.type	ID_CHK, @object
 163               		.size	ID_CHK, 1
 164               	ID_CHK:
 165 000a 01        		.byte	1
 166               	.global	SERIAL_NUMBER_CHK
 167               		.type	SERIAL_NUMBER_CHK, @object
 168               		.size	SERIAL_NUMBER_CHK, 1
 169               	SERIAL_NUMBER_CHK:
 170 000b FF        		.byte	-1
 171               	.global	WEIGAN_FORMAT_CHK
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciWbaaa.s 			page 4


 172               		.type	WEIGAN_FORMAT_CHK, @object
 173               		.size	WEIGAN_FORMAT_CHK, 1
 174               	WEIGAN_FORMAT_CHK:
 175 000c 01        		.byte	1
 176               	.global	AUTH_CODE_CHK
 177               		.type	AUTH_CODE_CHK, @object
 178               		.size	AUTH_CODE_CHK, 1
 179               	AUTH_CODE_CHK:
 180 000d 00        		.byte	0
 181               	.global	EEPROM_CHECK_CHK
 182               		.type	EEPROM_CHECK_CHK, @object
 183               		.size	EEPROM_CHECK_CHK, 1
 184               	EEPROM_CHECK_CHK:
 185 000e 00        		.byte	0
 186               	.global	RESET_DEFAULT_CHK
 187               		.type	RESET_DEFAULT_CHK, @object
 188               		.size	RESET_DEFAULT_CHK, 1
 189               	RESET_DEFAULT_CHK:
 190 000f 00        		.byte	0
 191               	.global	ALARM_LEVEL_CHK
 192               		.type	ALARM_LEVEL_CHK, @object
 193               		.size	ALARM_LEVEL_CHK, 1
 194               	ALARM_LEVEL_CHK:
 195 0010 01        		.byte	1
 196               	.global	ALARM_TIME_CHK
 197               		.type	ALARM_TIME_CHK, @object
 198               		.size	ALARM_TIME_CHK, 1
 199               	ALARM_TIME_CHK:
 200 0011 05        		.byte	5
 201               	.global	ALARM_ENABLE_CHK
 202               		.type	ALARM_ENABLE_CHK, @object
 203               		.size	ALARM_ENABLE_CHK, 1
 204               	ALARM_ENABLE_CHK:
 205 0012 01        		.byte	1
 206               	.global	TYPE_B_SETTING_CHK
 207               		.type	TYPE_B_SETTING_CHK, @object
 208               		.size	TYPE_B_SETTING_CHK, 1
 209               	TYPE_B_SETTING_CHK:
 210 0013 01        		.byte	1
 211               		.text
 212               		.stabs	"AVR_Init:F(0,20)",36,0,105,AVR_Init
 213               	.global	AVR_Init
 214               		.type	AVR_Init, @function
 215               	AVR_Init:
   1:main.c        **** 
   2:main.c        **** /*
   3:main.c        **** *--change on 2007-02-27,increase the sensitive of the card-reader,decrease the beep and led display
   4:main.c        **** *--version 1.1 
   5:main.c        **** *--add one command 0x07 and remove two old command 0x04 and 0x05;
   6:main.c        **** *--command 0x07 is used to configure the alarm level of ALARM1;
   7:main.c        **** *--add CYE power check, if CYE is high voltage, beep 2 when get a valid card no.
   8:main.c        **** */
   9:main.c        **** 
  10:main.c        **** #include <avr/io.h>
  11:main.c        **** #include <inttypes.h>
  12:main.c        **** #include <avr/interrupt.h>
  13:main.c        **** #include <avr/signal.h>
GAS LISTING C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/cciWbaaa.s 			page 5


  14:main.c        **** #include <avr/wdt.h>
  15:main.c        **** #include <avr/eeprom.h>
  16:main.c        **** #include <avr/pgmspace.h>
  17:main.c        **** 
  18:main.c        **** #include "level4.h"
  19:main.c        **** #include "level3.h"
  20:main.c        **** #include "level2.h"
  21:main.c        **** #include "level1.h"
  22:main.c        **** 
  23:main.c        **** //#define DEBUG 1 
  24:main.c        **** 
  25:main.c        **** // ==================================================================
  26:main.c        **** // capture variables
  27:main.c        **** 
  28:main.c        **** 
  29:main.c        **** uint8_t counter1set;                  //counter1 settings
  30:main.c        **** uint8_t forward_link_type;            //forward link modulation type
  31:main.c        **** uint8_t watchdog_reset;               //watchdog activated
  32:main.c        **** uint16_t write_4094_low = 0x681F;     // low word of SPI configuration word
  33:main.c        **** uint16_t write_4094_hi = 0x0260;      // hi word of SPI configuration word
  34:main.c        **** 
  35:main.c        **** uint8_t cmd_message[5] = { 0x05,0x00,0x00,0x71,0xFF};
  36:main.c        **** uint16_t fwd_B_timing;                //forward link pulse timing
  37:main.c        **** uint8_t cmd_message_len;              // length of current cmd_message
  38:main.c        **** 
  39:main.c        **** uint8_t weigan_format;
  40:main.c        **** //uint8_t weigan_enable;
  41:main.c        **** //uint8_t keyboard_enable;              //keyboard enable, 1--keyboard scan, 0 -- not keyboard scan
  42:main.c        **** 
  43:main.c        **** uint8_t ID __attribute__((section(".eeprom")))              = 0x01;
  44:main.c        **** uint8_t SERIAL_NUMBER __attribute__((section(".eeprom")))   = 0xFF;
  45:main.c        **** uint8_t WEIGAN_FORMAT __attribute__((section(".eeprom")))   = 0x01;
  46:main.c        **** uint8_t AUTH_CODE __attribute__((section(".eeprom")))       = 0x00;
  47:main.c        **** uint8_t EEPROM_CHECK __attribute__((section(".eeprom")))    = 0x00;
  48:main.c        **** uint8_t RESET_DEFAULT __attribute__((section(".eeprom")))   = 0x00;
  49:main.c        **** uint8_t ALARM_LEVEL __attribute__((section(".eeprom")))     = 0x01;
  50:main.c        **** uint8_t ALARM_TIME __attribute__((section(".eeprom")))      = 0x05;
  51:main.c        **** uint8_t ALARM_ENABLE __attribute__((section(".eeprom")))    = 0x01;
  52:main.c        **** uint8_t TYPE_B_SETTING __attribute__((section(".eeprom")))  = 0x01;

⌨️ 快捷键说明

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