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

📄 main.lss

📁 AVR做的打印机控制例子,基于AVR和CH375
💻 LSS
📖 第 1 页 / 共 5 页
字号:

main.elf:     file format elf32-avr

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .data         00000116  00800100  000045a4  00004638  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  1 .text         000045a4  00000000  00000000  00000094  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .bss          00000872  00800216  00800216  0000474e  2**0
                  ALLOC
  3 .stab         00000408  00000000  00000000  00004750  2**2
                  CONTENTS, READONLY, DEBUGGING
  4 .stabstr      00000084  00000000  00000000  00004b58  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .debug_aranges 00000020  00000000  00000000  00004bdc  2**0
                  CONTENTS, READONLY, DEBUGGING
  6 .debug_pubnames 0000011e  00000000  00000000  00004bfc  2**0
                  CONTENTS, READONLY, DEBUGGING
  7 .debug_info   00000ec3  00000000  00000000  00004d1a  2**0
                  CONTENTS, READONLY, DEBUGGING
  8 .debug_abbrev 00000253  00000000  00000000  00005bdd  2**0
                  CONTENTS, READONLY, DEBUGGING
  9 .debug_line   00000768  00000000  00000000  00005e30  2**0
                  CONTENTS, READONLY, DEBUGGING
 10 .debug_frame  000000e0  00000000  00000000  00006598  2**0
                  CONTENTS, READONLY, DEBUGGING
 11 .debug_str    00000051  00000000  00000000  00006678  2**0
                  CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:

00000000 <__vectors>:
       0:	0c 94 46 00 	jmp	0x8c	; 0x8c <__ctors_end>
       4:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
       8:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
       c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      10:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      14:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      18:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      1c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      20:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      24:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      28:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      2c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      30:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      34:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      38:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      3c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      40:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      44:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      48:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      4c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      50:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      54:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      58:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      5c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      60:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      64:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      68:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      6c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      70:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      74:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      78:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      7c:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      80:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      84:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>
      88:	0c 94 63 00 	jmp	0xc6	; 0xc6 <__bad_interrupt>

0000008c <__ctors_end>:
      8c:	11 24       	eor	r1, r1
      8e:	1f be       	out	0x3f, r1	; 63
      90:	cf ef       	ldi	r28, 0xFF	; 255
      92:	d0 e1       	ldi	r29, 0x10	; 16
      94:	de bf       	out	0x3e, r29	; 62
      96:	cd bf       	out	0x3d, r28	; 61

00000098 <__do_copy_data>:
      98:	12 e0       	ldi	r17, 0x02	; 2
      9a:	a0 e0       	ldi	r26, 0x00	; 0
      9c:	b1 e0       	ldi	r27, 0x01	; 1
      9e:	e4 ea       	ldi	r30, 0xA4	; 164
      a0:	f5 e4       	ldi	r31, 0x45	; 69
      a2:	00 e0       	ldi	r16, 0x00	; 0
      a4:	0b bf       	out	0x3b, r16	; 59
      a6:	02 c0       	rjmp	.+4      	; 0xac <__do_copy_data+0x14>
      a8:	07 90       	elpm	r0, Z+
      aa:	0d 92       	st	X+, r0
      ac:	a6 31       	cpi	r26, 0x16	; 22
      ae:	b1 07       	cpc	r27, r17
      b0:	d9 f7       	brne	.-10     	; 0xa8 <__do_copy_data+0x10>

000000b2 <__do_clear_bss>:
      b2:	1a e0       	ldi	r17, 0x0A	; 10
      b4:	a6 e1       	ldi	r26, 0x16	; 22
      b6:	b2 e0       	ldi	r27, 0x02	; 2
      b8:	01 c0       	rjmp	.+2      	; 0xbc <.do_clear_bss_start>

000000ba <.do_clear_bss_loop>:
      ba:	1d 92       	st	X+, r1

000000bc <.do_clear_bss_start>:
      bc:	a8 38       	cpi	r26, 0x88	; 136
      be:	b1 07       	cpc	r27, r17
      c0:	e1 f7       	brne	.-8      	; 0xba <.do_clear_bss_loop>
      c2:	0c 94 e2 04 	jmp	0x9c4	; 0x9c4 <main>

000000c6 <__bad_interrupt>:
      c6:	0c 94 00 00 	jmp	0	; 0x0 <__vectors>

000000ca <xQueryInterrupt>:

#ifndef NO_DEFAULT_CH375_INT			/* 在应用程序中定义NO_DEFAULT_CH375_INT可以禁止默认的中断处理程序,然后用自行编写的程序代替它 */
#if LIB_CFG_INT_EN == 0					/* CH375的INT#引脚连接方式为"查询方式" */
void xQueryInterrupt( void )			/* 查询CH375中断并更新中断状态 */
{
      ca:	cf 93       	push	r28
      cc:	df 93       	push	r29
      ce:	cd b7       	in	r28, 0x3d	; 61
      d0:	de b7       	in	r29, 0x3e	; 62
#ifdef CH375_INT_WIRE  /* 查询中断引脚 */
	while ( CH375_INT_WIRE );  /* 如果CH375的中断引脚输出高电平则等待 */
      d2:	e0 e3       	ldi	r30, 0x30	; 48
      d4:	f0 e0       	ldi	r31, 0x00	; 0
      d6:	80 81       	ld	r24, Z
      d8:	99 27       	eor	r25, r25
      da:	81 70       	andi	r24, 0x01	; 1
      dc:	90 70       	andi	r25, 0x00	; 0
      de:	88 23       	and	r24, r24
      e0:	c1 f7       	brne	.-16     	; 0xd2 <xQueryInterrupt+0x8>
#else  /* 对于CH375B芯片还可以查询命令端口的位7 */
	while ( xReadCH375Cmd( ) & 0x80 );  /* 查询CH375B的命令端口的位7为1说明中断引脚输出高电平则等待 */
#endif
	xWriteCH375Cmd( CMD_GET_STATUS );  /* 获取当前中断状态,发出命令后至少延时2uS */
      e2:	82 e2       	ldi	r24, 0x22	; 34
      e4:	0e 94 f8 00 	call	0x1f0	; 0x1f0 <xWriteCH375Cmd>
	CH375IntStatus = xReadCH375Data( );  /* 获取中断状态 */
      e8:	0e 94 58 03 	call	0x6b0	; 0x6b0 <xReadCH375Data>
      ec:	80 93 44 0a 	sts	0x0A44, r24
	if ( CH375IntStatus == USB_INT_DISCONNECT ) CH375DiskStatus = DISK_DISCONNECT;  /* 检测到USB设备断开事件 */
      f0:	80 91 44 0a 	lds	r24, 0x0A44
      f4:	86 31       	cpi	r24, 0x16	; 22
      f6:	21 f4       	brne	.+8      	; 0x100 <xQueryInterrupt+0x36>
      f8:	81 e0       	ldi	r24, 0x01	; 1
      fa:	80 93 61 0a 	sts	0x0A61, r24
      fe:	07 c0       	rjmp	.+14     	; 0x10e <xQueryInterrupt+0x44>
	else if ( CH375IntStatus == USB_INT_CONNECT ) CH375DiskStatus = DISK_CONNECT;  /* 检测到USB设备连接事件 */
     100:	80 91 44 0a 	lds	r24, 0x0A44
     104:	85 31       	cpi	r24, 0x15	; 21
     106:	19 f4       	brne	.+6      	; 0x10e <xQueryInterrupt+0x44>
     108:	82 e0       	ldi	r24, 0x02	; 2
     10a:	80 93 61 0a 	sts	0x0A61, r24
     10e:	df 91       	pop	r29
     110:	cf 91       	pop	r28
     112:	08 95       	ret

00000114 <xDelay100uS>:
}
#else									/* LIB_CFG_INT_EN != 0, CH375的INT#引脚连接方式为"中断方式" */
void xQueryInterrupt( void )			/* 查询中断状态,等待硬件中断 */
{
	while ( CH375IntStatus == 0 );		/* 子程序库调用该子程序之前CH375IntStatus=0,硬件中断后,由中断服务程序置为非0的实际中断状态后返回 */
}
void	CH375Interrupt( void ) __attribute__ ((signal));
void	CH375Interrupt( void )			/* CH375中断服务程序,由CH375的INT#的低电平或者下降沿触发单片机中断 */
{
	xWriteCH375Cmd( CMD_GET_STATUS );  /* 获取中断状态并取消中断请求 */
	CH375IntStatus = xReadCH375Data( );  /* 获取中断状态 */
	if ( CH375IntStatus == USB_INT_DISCONNECT ) CH375DiskStatus = DISK_DISCONNECT;  /* 检测到USB设备断开事件 */
	else if ( CH375IntStatus == USB_INT_CONNECT ) CH375DiskStatus = DISK_CONNECT;  /* 检测到USB设备连接事件 */
#ifdef CLEAR_INT_MARK
	CLEAR_INT_MARK( );  /* 某些单片机需要由软件清除中断标志 */
#endif
}
#endif
#endif

#ifndef NO_DEFAULT_DELAY_100US			/* 在应用程序中定义NO_DEFAULT_DELAY_100US可以禁止默认的延时100uS子程序,然后用自行编写的程序代替它 */
void xDelay100uS( void )				/* 延时100uS */
{
     114:	cf 93       	push	r28
     116:	df 93       	push	r29
     118:	cd b7       	in	r28, 0x3d	; 61
     11a:	de b7       	in	r29, 0x3e	; 62
     11c:	22 97       	sbiw	r28, 0x02	; 2
     11e:	0f b6       	in	r0, 0x3f	; 63
     120:	f8 94       	cli
     122:	de bf       	out	0x3e, r29	; 62
     124:	0f be       	out	0x3f, r0	; 63
     126:	cd bf       	out	0x3d, r28	; 61
//	UINT16	count;
//	for ( count = 330; count != 0; count -- );  /* 延时100uS,6x50nS@20MHz */
// 以上代码会被优化掉,所以用嵌入式汇编
	UINT16	count = 500;  /* 延时100uS,4x50nS@20MHz */
     128:	84 ef       	ldi	r24, 0xF4	; 244
     12a:	91 e0       	ldi	r25, 0x01	; 1
     12c:	9a 83       	std	Y+2, r25	; 0x02
     12e:	89 83       	std	Y+1, r24	; 0x01
	__asm__ volatile (
     130:	89 81       	ldd	r24, Y+1	; 0x01
     132:	9a 81       	ldd	r25, Y+2	; 0x02
     134:	01 97       	sbiw	r24, 0x01	; 1
     136:	f1 f7       	brne	.-4      	; 0x134 <xDelay100uS+0x20>
     138:	9a 83       	std	Y+2, r25	; 0x02
     13a:	89 83       	std	Y+1, r24	; 0x01
     13c:	22 96       	adiw	r28, 0x02	; 2
     13e:	0f b6       	in	r0, 0x3f	; 63
     140:	f8 94       	cli
     142:	de bf       	out	0x3e, r29	; 62
     144:	0f be       	out	0x3f, r0	; 63
     146:	cd bf       	out	0x3d, r28	; 61
     148:	df 91       	pop	r29
     14a:	cf 91       	pop	r28
     14c:	08 95       	ret

0000014e <xDelayAfterWrite>:
		"1: sbiw %0,1" "\n\t"
		"brne 1b"
		: "=w" (count)
		: "0" (count)
	);
}
#endif

#ifdef EN_DISK_WRITE
#ifndef NO_DEFAULT_DELAY_WRITE			/* 在应用程序中定义NO_DEFAULT_DELAY_WRITE可以禁止默认的写操作后延时程序,然后用自行编写的程序代替它 */
void xDelayAfterWrite( void )			/* 写操作后延时 */
{
     14e:	cf 93       	push	r28
     150:	df 93       	push	r29
     152:	cd b7       	in	r28, 0x3d	; 61
     154:	de b7       	in	r29, 0x3e	; 62
     156:	22 97       	sbiw	r28, 0x02	; 2
     158:	0f b6       	in	r0, 0x3f	; 63
     15a:	f8 94       	cli
     15c:	de bf       	out	0x3e, r29	; 62
     15e:	0f be       	out	0x3f, r0	; 63
     160:	cd bf       	out	0x3d, r28	; 61
//	UINT16	count;
//	for ( count = 650; count != 0; count -- );  /* 延时200uS左右 */
// 以上代码会被优化掉,所以用嵌入式汇编
	UINT16	count = 1000;  /* 延时200uS,4x50nS@20MHz */
     162:	88 ee       	ldi	r24, 0xE8	; 232
     164:	93 e0       	ldi	r25, 0x03	; 3
     166:	9a 83       	std	Y+2, r25	; 0x02
     168:	89 83       	std	Y+1, r24	; 0x01
	__asm__ volatile (
     16a:	89 81       	ldd	r24, Y+1	; 0x01
     16c:	9a 81       	ldd	r25, Y+2	; 0x02
     16e:	01 97       	sbiw	r24, 0x01	; 1
     170:	f1 f7       	brne	.-4      	; 0x16e <xDelayAfterWrite+0x20>
     172:	9a 83       	std	Y+2, r25	; 0x02
     174:	89 83       	std	Y+1, r24	; 0x01
     176:	22 96       	adiw	r28, 0x02	; 2
     178:	0f b6       	in	r0, 0x3f	; 63
     17a:	f8 94       	cli
     17c:	de bf       	out	0x3e, r29	; 62
     17e:	0f be       	out	0x3f, r0	; 63
     180:	cd bf       	out	0x3d, r28	; 61
     182:	df 91       	pop	r29
     184:	cf 91       	pop	r28
     186:	08 95       	ret

00000188 <xFileNameEnumer>:
		"1: sbiw %0,1" "\n\t"
		"brne 1b"
		: "=w" (count)
		: "0" (count)
	);
}
#endif
#endif

#ifndef NO_DEFAULT_FILE_ENUMER			/* 在应用程序中定义NO_DEFAULT_FILE_ENUMER可以禁止默认的文件名枚举回调程序,然后用自行编写的程序代替它 */
void xFileNameEnumer( void )			/* 文件名枚举回调子程序 */
{
     188:	cf 93       	push	r28
     18a:	df 93       	push	r29
     18c:	cd b7       	in	r28, 0x3d	; 61
     18e:	de b7       	in	r29, 0x3e	; 62
     190:	df 91       	pop	r29
     192:	cf 91       	pop	r28
     194:	08 95       	ret

00000196 <CH375LibInit>:
/* 如果指定枚举序号CH375vFileSize为0xFFFFFFFF后调用FileOpen,那么每搜索到一个文件FileOpen都会调用本回调程序,
   回调程序xFileNameEnumer返回后,FileOpen递减CH375vFileSize并继续枚举直到搜索不到文件或者目录。建议做法是,
   在调用FileOpen之前定义一个全局变量为0,当FileOpen回调本程序后,本程序由CH375vFdtOffset得到结构FAT_DIR_INFO,
   分析结构中的DIR_Attr以及DIR_Name判断是否为所需文件名或者目录名,记录相关信息,并将全局变量计数增量,
   当FileOpen返回后,判断返回值如果是ERR_MISS_FILE或ERR_FOUND_NAME都视为操作成功,全局变量为搜索到的有效文件数。
   如果在本回调程序xFileNameEnumer中将CH375vFileSize置为1,那么可以通知FileOpen提前结束搜索。以下是回调程序例子 */
#if 0
#ifdef FILE_DATA_BUF_LEN
	UINT8			i;
	UINT16			FileCount;
	P_FAT_DIR_INFO	pFileDir;
	PUINT8			NameBuf;

⌨️ 快捷键说明

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