📄 steper.lst
字号:
265 out (62)+1-32,r19
266 out 62-32,r18
204:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
205:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom
206:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** Read one 16-bit word (little endian) from EEPROM address \a __p.
207:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** */
208:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** __ATTR_PURE__ static __inline__ uint16_t eeprom_read_word (const uint16_t *__p)
209:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** {
210:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** return __eerd_word (__p, eeprom_read_byte);
211:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** }
212:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
213:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom
214:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** Read one 32-bit double word (little endian) from EEPROM address \a __p.
215:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** */
216:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** __ATTR_PURE__ static __inline__
217:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** uint32_t eeprom_read_dword (const uint32_t *__p)
218:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** {
219:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** return __eerd_dword (__p, eeprom_read_byte);
220:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** }
221:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
222:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom
223:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** Read a block of \a __n bytes from EEPROM address \a __src to SRAM
224:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** \a __dst.
225:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** */
226:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** static __inline__ void
227:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** eeprom_read_block (void *__dst, const void *__src, size_t __n)
228:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** {
229:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** __eerd_block (__dst, __src, __n, eeprom_read_byte);
230:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** }
231:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
232:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** /** \ingroup avr_eeprom
233:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** Write a byte \a __value to EEPROM address \a __p.
234:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** */
235:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** static __inline__ void eeprom_write_byte (uint8_t *__p, uint8_t __value)
236:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** {
267 8,0,250,.LM11-.LFBB3
268 .LM11:
269 out 61-32,r22
271 .LM12:
272 0104 9C01 /* #APP */
273 ; 252 "d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h" 1
237:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** do {} while (!eeprom_is_ready ());
274 RT EEPROM WRITE CRITICAL SECTION */
275 in r0, 63
276 0106 E199 cli
277 0108 00C0 sbi 28, 2
238:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
239:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #if defined(EEPM0) && defined(EEPM1)
240:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** EECR = 0; /* Set programming mode: erase and write. */
241:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #elif defined(EEPM0) || defined(EEPM1)
242:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** # warning "Unknown EECR register, eeprom_write_byte() has become outdated."
243:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #endif
244:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
245:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #if E2END <= 0xFF
246:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** EEARL = (unsigned)__p;
247:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #else
248:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** EEAR = (unsigned)__p;
278 28, 1
279 out 63, r0
280 010a 3FBB /* END EEPROM WRITE CRITICAL SECTION */
281 010c 2EBB ; 0 "" 2
249:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** #endif
250:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** EEDR = __value;
282 pilogue start */
284 010e 6DBB .LM13:
251:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h ****
252:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** __asm__ __volatile__ (
285 #NOAPP */
286 ret
288 .Lscope3:
290 0110 0FB6 .global __vector_1
292 0114 E29A __vector_1:
294 0118 0FBE .Ltext3:
296 .LM14:
297 .LFBB4:
253:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "/* START EEPROM WRITE CRITICAL SECTION */\n\t"
254:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "in r0, %[__sreg] \n\t"
255:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "cli \n\t"
256:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "sbi %[__eecr], %[__eemwe] \n\t"
257:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "sbi %[__eecr], %[__eewe] \n\t"
258:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "out %[__sreg], r0 \n\t"
259:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** "/* END EEPROM WRITE CRITICAL SECTION */"
260:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** :
261:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** : [__eecr] "i" (_SFR_IO_ADDR(EECR)),
262:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** [__sreg] "i" (_SFR_IO_ADDR(SREG)),
263:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** [__eemwe] "i" (EEMWE),
264:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** [__eewe] "i" (EEWE)
265:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** : "r0"
266:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** );
267:d:/winavr-20080610/lib/gcc/../../avr/include/avr/eeprom.h **** }
298 reg__
299 push r0
300 in r0,__SREG__
301 011a 0895 push r0
302 clr __zero_reg__
303 push r24
304 /* prologue: Signal */
305 /* frame size = 0 */
307 .LM15:
308 /* #APP */
309 ; 111 "steper.c" 1
1:steper.c **** #include <avr/io.h>
2:steper.c **** #include <avr/interrupt.h>
3:steper.c **** #include <avr/eeprom.h>
4:steper.c **** #include <stdint.h>
5:steper.c ****
6:steper.c **** #define ShortPush 0x40
7:steper.c **** #define LongPush 0x80
8:steper.c ****
9:steper.c **** volatile uint8_t Direction=0,Limit=0;
10:steper.c **** volatile uint8_t Pflag=0,TuneFlag=0;
11:steper.c **** volatile SlowSpeed=0;
12:steper.c **** static uint8_t stepper[8]={0x80,0xC0,0x40,0x60,0x20,0x30,0x10,0x90};
13:steper.c **** volatile uint16_t Position[2]={0x00,0x00};
14:steper.c **** volatile uint8_t keycode=0x00;
15:steper.c **** volatile uint8_t LastKey=0xFF,CurKey=0x00;
16:steper.c **** volatile uint8_t keytimes=0x00;
17:steper.c **** volatile uint8_t key_limit=0x00;
18:steper.c **** volatile uint8_t stepcnt=0;
19:steper.c **** volatile uint16_t Pcnt=0;
20:steper.c ****
21:steper.c **** #define StepperStop() { TCCR1B=0x00; PORTD&=~(1<<PD3); PORTC&=~(1<<PC2|1<<PC3); }//Disable driver
22:steper.c **** #define StepperStart() { PORTD|=(1<<PD3); TCCR1B=(1<<CS02|1<<CS00); TIMSK|=1<<TOIE1;}//Enable drive
23:steper.c ****
24:steper.c **** ISR(SIG_OVERFLOW1)
25:steper.c **** {
26:steper.c **** TCCR1B=0x00;//停止定时器
27:steper.c **** if(SlowSpeed==1) //60ms
28:steper.c **** {
29:steper.c **** TCNT1H=0xC5;
30:steper.c **** TCNT1L=0x69;
31:steper.c **** }
32:steper.c **** else if(SlowSpeed==0) //15ms
33:steper.c **** {
34:steper.c **** TCNT1H=0xF1;
35:steper.c **** TCNT1L=0x5B;
36:steper.c **** }
37:steper.c ****
38:steper.c **** if(Direction==0)
39:steper.c **** {
40:steper.c **** PORTC&=~(1<<PC2|1<<PC3);
41:steper.c **** PORTD=((1<<PD3)|stepper[stepcnt]);
42:steper.c **** stepcnt++;
43:steper.c **** if(stepcnt>7) stepcnt=0;
44:steper.c **** PORTC|=1<<PC2;
45:steper.c **** }
46:steper.c **** else if(Direction==1)
47:steper.c **** {
48:steper.c **** PORTC&=~(1<<PC3|1<<PC2);
49:steper.c **** PORTD=((1<<PD3)|stepper[stepcnt]);
50:steper.c **** stepcnt--;
51:steper.c **** if(stepcnt==0xFF) stepcnt=7;
52:steper.c **** PORTC|=1<<PC3;
53:steper.c **** }
54:steper.c ****
55:steper.c **** if(TuneFlag!=0)
56:steper.c **** {
57:steper.c **** switch(TuneFlag)
58:steper.c **** {
59:steper.c **** case 0x01:
60:steper.c **** case 0x03:
61:steper.c **** if(Limit==0x00)
62:steper.c **** if(Pcnt>0) Pcnt--;
63:steper.c **** else
64:steper.c **** Pcnt++;
65:steper.c **** break;
66:steper.c **** case 0x02:
67:steper.c **** case 0x04:
68:steper.c **** if(Limit==0x00)
69:steper.c **** Pcnt++;
70:steper.c **** else
71:steper.c **** {
72:steper.c **** if(Pcnt>0) Pcnt--;
73:steper.c **** }
74:steper.c **** break;
75:steper.c **** default:
76:steper.c **** break;
77:steper.c **** }
78:steper.c **** Position[Limit]=Pcnt;
79:steper.c **** eeprom_is_ready();
80:steper.c **** eeprom_write_word((Limit==0x00 ? 0x01 : 0x03),Position[Limit]);
81:steper.c ****
82:steper.c **** if(TuneFlag==1 || TuneFlag==2)
83:steper.c **** {
84:steper.c **** StepperStop();
85:steper.c **** goto T0End;
86:steper.c **** }
87:steper.c **** else
88:steper.c **** StepperStart();
89:steper.c **** goto T0End;
90:steper.c **** }
91:steper.c ****
92:steper.c **** if(Pflag==1)
93:steper.c **** {
94:steper.c **** Pcnt++;
95:steper.c **** if(Pcnt>=Position[Limit])
96:steper.c **** {
97:steper.c **** StepperStop();
98:steper.c **** goto T0End;
99:steper.c **** }
100:steper.c **** else
101:steper.c **** TCCR1B=(1<<CS11|1<<CS10);//启动定时器
102:steper.c **** }
103:steper.c **** else
104:steper.c **** TCCR1B=(1<<CS11|1<<CS10);//启动定时器
105:steper.c **** T0End:
106:steper.c **** ;
107:steper.c **** }
108:steper.c ****
109:steper.c **** ISR(SIG_INTERRUPT0)
110:steper.c **** {
310 " 2
312 .LM16:
313 011c 1F92 /* #NOAPP */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -