📄 systime.lst
字号:
775 0232 0F84 ldd __tmp_reg__,Y+15
776 0234 D889 ldd r29,Y+16
777 0236 C02D mov r28,__tmp_reg__
778 0238 2097 sbiw r28,0
779 023a 71F0 breq .L25
780 023c F401 movw r30,r8
781 023e 2381 ldd r18,Z+3
782 0240 3481 ldd r19,Z+4
783 0242 4581 ldd r20,Z+5
784 0244 5681 ldd r21,Z+6
785 0246 8B81 ldd r24,Y+3
786 0248 9C81 ldd r25,Y+4
787 024a AD81 ldd r26,Y+5
788 024c BE81 ldd r27,Y+6
789 024e 2817 cp r18,r24
790 0250 3907 cpc r19,r25
791 0252 4A07 cpc r20,r26
792 0254 5B07 cpc r21,r27
793 0256 60F7 brsh .L26
794 .L25:
237:systime.c ****
238:systime.c **** //}
239:systime.c **** if(p_temp2!=queue_head)
240:systime.c **** {
796 .LM76:
797 0258 C615 cp r28,r6
798 025a D705 cpc r29,r7
799 025c 49F0 breq .L27
241:systime.c **** Leds_redToggle();
242:systime.c **** //printf("\nticks is %04x,ticksleft is %08lx,reason is %02x,temp->reason is %02x\n",temp->
801 .LM77:
802 025e 0E94 0000 call Leds_redToggle
243:systime.c **** p_temp1->next=temp;
244:systime.c **** temp->next=p_temp2;
804 .LM78:
805 0262 F601 movw r30,r12
806 0264 8786 std Z+15,r8
807 0266 908A std Z+16,r9
245:systime.c **** }
809 .LM79:
810 0268 F401 movw r30,r8
811 026a C787 std Z+15,r28
812 026c D08B std Z+16,r29
813 026e 09C0 rjmp .L21
814 .L27:
246:systime.c **** else
247:systime.c **** //为头节点,需要调整物理定时器
248:systime.c **** {
249:systime.c ****
250:systime.c **** Timer1_adjustInterval(temp->ticks);
251:systime.c **** // printf("\nbecome head ticks is %04x,ticksleft is %08lx,reason is %02x,temp->reason is %0
816 .LM80:
817 0270 F401 movw r30,r8
818 0272 8181 ldd r24,Z+1
819 0274 9281 ldd r25,Z+2
820 0276 0E94 0000 call Timer1_adjustInterval
252:systime.c **** temp->next=queue_head;
253:systime.c **** queue_head=temp;
822 .LM81:
823 027a F401 movw r30,r8
824 027c 6786 std Z+15,r6
825 027e 708A std Z+16,r7
826 .L31:
254:systime.c **** }
828 .LM82:
829 0280 3401 movw r6,r8
830 .L21:
255:systime.c **** }
256:systime.c **** return queue_head;
257:systime.c **** }
258:systime.c ****
832 .LM83:
833 0282 C301 movw r24,r6
834 /* epilogue: frame size=0 */
835 0284 DF91 pop r29
836 0286 CF91 pop r28
837 0288 1F91 pop r17
838 028a 0F91 pop r16
839 028c FF90 pop r15
840 028e EF90 pop r14
841 0290 DF90 pop r13
842 0292 CF90 pop r12
843 0294 BF90 pop r11
844 0296 AF90 pop r10
845 0298 9F90 pop r9
846 029a 8F90 pop r8
847 029c 7F90 pop r7
848 029e 6F90 pop r6
849 02a0 5F90 pop r5
850 02a2 4F90 pop r4
851 02a4 3F90 pop r3
852 02a6 2F90 pop r2
853 02a8 0895 ret
854 /* epilogue end (size=19) */
855 /* function systimer_start_task size 193 (156) */
865 .global systimer_stop_task
867 systimer_stop_task:
259:systime.c **** systimer_queue_pointer systimer_stop_task(systimer_queue_pointer queue_head,uint8_t timer_reason)
260:systime.c **** {
261:systime.c **** //依据取消的framehandle,如果是队列头,则需要重新设置比较寄存器的值,否则只需把它从队列中摘掉即可。
869 .LM84:
870 /* prologue: frame size=0 */
871 02aa EF92 push r14
872 02ac FF92 push r15
873 02ae 0F93 push r16
874 02b0 1F93 push r17
875 02b2 CF93 push r28
876 02b4 DF93 push r29
877 /* prologue end (size=6) */
878 02b6 7C01 movw r14,r24
262:systime.c **** systimer_queue_pointer p_temp1,p_temp2,p_temp3;
263:systime.c **** p_temp1=queue_head;
264:systime.c **** p_temp2=queue_head;
880 .LM85:
881 02b8 FC01 movw r30,r24
265:systime.c **** p_temp3=queue_head;
883 .LM86:
884 02ba EC01 movw r28,r24
885 .L43:
266:systime.c **** while((p_temp2->timer_reason!=timer_reason)&&(p_temp2!=NULL))
267:systime.c **** {
268:systime.c **** p_temp1=p_temp2;
269:systime.c **** p_temp2=p_temp2->next;
270:systime.c **** }
887 .LM87:
888 02bc 8881 ld r24,Y
889 02be 8617 cp r24,r22
890 02c0 29F0 breq .L34
892 .LM88:
893 02c2 FE01 movw r30,r28
895 .LM89:
896 02c4 0F84 ldd __tmp_reg__,Y+15
897 02c6 D889 ldd r29,Y+16
898 02c8 C02D mov r28,__tmp_reg__
899 02ca F8CF rjmp .L43
900 .L34:
271:systime.c **** if(p_temp2==NULL)
272:systime.c **** error("cannot find an element in the timer_queue");
273:systime.c **** else
274:systime.c **** {
275:systime.c **** p_temp3=p_temp2->next;
276:systime.c **** if(p_temp2==queue_head)
902 .LM90:
903 02cc 0F85 ldd r16,Y+15
904 02ce 1889 ldd r17,Y+16
277:systime.c **** {
906 .LM91:
907 02d0 CE15 cp r28,r14
908 02d2 DF05 cpc r29,r15
909 02d4 69F4 brne .L38
278:systime.c **** if(p_temp2->next==NULL)
279:systime.c **** {
911 .LM92:
912 02d6 0115 cp r16,__zero_reg__
913 02d8 1105 cpc r17,__zero_reg__
914 02da 19F4 brne .L39
280:systime.c **** //printf("\n***timer 1_OCR intrrput is diabled\n");
281:systime.c **** Timer1_OCR_intDisable();
282:systime.c **** }
916 .LM93:
917 02dc 0E94 0000 call Timer1_OCR_intDisable
918 02e0 05C0 rjmp .L40
919 .L39:
283:systime.c **** else
284:systime.c **** {
285:systime.c **** //重新设置定时器
286:systime.c **** Timer1_adjustInterval(p_temp3->ticks);
287:systime.c **** }
921 .LM94:
922 02e2 F801 movw r30,r16
923 02e4 8181 ldd r24,Z+1
924 02e6 9281 ldd r25,Z+2
925 02e8 0E94 0000 call Timer1_adjustInterval
926 .L40:
288:systime.c **** //取下head节点,释放空间
289:systime.c **** queue_head=p_temp3;
290:systime.c **** free(p_temp2);
928 .LM95:
929 02ec 7801 movw r14,r16
930 02ee 02C0 rjmp .L44
931 .L38:
291:systime.c **** }
292:systime.c **** else
293:systime.c **** {
294:systime.c **** p_temp1->next=p_temp3;
295:systime.c **** free(p_temp2);
933 .LM96:
934 02f0 0787 std Z+15,r16
935 02f2 108B std Z+16,r17
936 .L44:
296:systime.c **** }
938 .LM97:
939 02f4 CE01 movw r24,r28
940 02f6 0E94 0000 call free
297:systime.c **** }
298:systime.c **** return queue_head;
299:systime.c **** }
300:systime.c ****
942 .LM98:
943 02fa C701 movw r24,r14
944 /* epilogue: frame size=0 */
945 02fc DF91 pop r29
946 02fe CF91 pop r28
947 0300 1F91 pop r17
948 0302 0F91 pop r16
949 0304 FF90 pop r15
950 0306 EF90 pop r14
951 0308 0895 ret
952 /* epilogue end (size=7) */
953 /* function systimer_stop_task size 48 (35) */
958 .data
959 .LC1:
960 0000 0A2A 2A2A .string "\n***system awake***"
960 7379 7374
960 656D 2061
960 7761 6B65
960 2A2A 2A00
961 .LC2:
962 0014 0A2A 2A2A .string "\n***system sleeping***"
962 7379 7374
962 656D 2073
962 6C65 6570
962 696E 672A
963 .LC3:
964 002b 0A6C 6F73 .string "\nloss syn"
964 7320 7379
964 6E00
965 .LC4:
966 0035 7772 6F6E .string "wrong systime reason!\n"
966 6720 7379
966 7374 696D
966 6520 7265
966 6173 6F6E
967 .text
970 .global systimer_task_fire
972 systimer_task_fire:
301:systime.c **** extern MAC_STATE_TYPE mac_current_state_saved;
302:systime.c ****
303:systime.c **** void systimer_task_fire(char timer_reason)
304:systime.c **** {
305:systime.c **** switch(timer_reason)
974 .LM99:
975 /* prologue: frame size=0 */
976 /* prologue end (size=0) */
306:systime.c **** {
978 .LM100:
979 030a 9927 clr r25
980 030c 8230 cpi r24,2
981 030e 9105 cpc r25,__zero_reg__
982 0310 E9F0 breq .L50
984 .LM101:
985 0312 8330 cpi r24,3
986 0314 9105 cpc r25,__zero_reg__
987 0316 34F4 brge .L59
988 0318 0097 sbiw r24,0
989 031a 59F0 breq .L47
990 031c 0197 sbiw r24,1
991 031e 09F4 brne .+2
992 0320 50C0 rjmp .L45
993 0322 4BC0 rjmp .L58
994 .L59:
995 0324 8330 cpi r24,3
996 0326 9105 cpc r25,__zero_reg__
997 0328 09F4 brne .+2
998 032a 42C0 rjmp .L57
999 032c 0497 sbiw r24,4
1000 032e 21F1 breq .L52
1001 0330 44C0 rjmp .L58
1002 .L47:
307:systime.c **** case(BEACON_SEND):
308:systime.c **** //call beacon_send
309:systime.c **** Leds_yellowOn();
310:systime.c **** Leds_greenOn();
1004 .LM102:
1005 0332 0E94 0000 call Leds_yellowOn
311:systime.c **** //Leds_redOn();
1007 .LM103:
1008 0336 0E94 0000 call Leds_greenOn
312:systime.c **** phy_channel_state=TRANSMITTING_FRAME;
313:systime.c ****
1010 .LM104:
1011 033a 82E0 ldi r24,lo8(2)
1012 033c 8093 0000 sts phy_channel_state,r24
314:systime.c **** //mlmeStartRequest(mac_pib_data.macPANId, ppib.phyCurrentChanel, mac_pib_data.macBeaconOrder, m
315:systime.c **** beacon_frame_send(TRUE);
316:systime.c **** printf("\n***system awake***\n");
1014 .LM105:
1015 0340 81E0 ldi r24,lo8(1)
1016 0342 0E94 0000 call beacon_frame_send
317:systime.c **** break;
1018 .LM106:
1019 0346 80E0 ldi r24,lo8(.LC1)
1020 0348 90E0 ldi r25,hi8(.LC1)
1021 034a 13C0 rjmp .L60
1022 .L50:
318:systime.c **** case(RECEIVE_BEACON):
319:systime.c **** //wait for beacon receive
320:systime.c **** //Leds_redOff();
321:systime.c **** //printf("\nsystimer interrupt");
322:systime.c **** if(!IS_COORDINATOR)
323:systime.c **** {
324:systime.c **** Leds_yellowOn();
325:systime.c **** Leds_greenOn();
326:systime.c **** Leds_redOn();
327:systime.c **** //if(mac_current_state_saved==MAC_STATE_ASSOC_WAIT_FOR_RESPONSE)
328:systime.c **** // mac_current_state=MAC_STATE_ASSOC_WAIT_FOR_RESPONSE;
329:systime.c **** //else
330:systime.c **** mac_current_state=MAC_STATE_IDLE;
331:systime.c **** phy_channel_state=WAITING_FOR_BEACON;
332:systime.c **** PLME_SET_TRX_STATE_request(RX_ON);
333:systime.c **** Is_received_beacon=FALSE;
334:systime.c **** //printf("\n***system waking***\n");
335:systime.c **** }
336:systime.c ****
337:systime.c **** //Leds_greenToggle();
338:systime.c ****
339:systime.c **** //head_of_systimer_queue=systimer_start_task(head_of_systimer_queue,RECEIVE_BEACON, 500) ;
340:systime.c **** //mlmeStartRequest(mac_pib_data.macPANId, ppib.phyCurrentChanel, mac_pib_data.macBeaconOrder, m
341:systime.c ****
342:systime.c **** break;
343:systime.c **** case(CAP_OVER):
344:systime.c **** //inactive the system
345:systime.c **** phy_channel_state=INACTIVE_PERIOD;
346:systime.c **** //对于采用间接通信的response帧可能要跨超帧操作
1024 .LM107:
1025 034c 85E0 ldi r24,lo8(5)
1026 034e 8093 0000 sts phy_channel_state,r24
347:systime.c **** mac_current_state_saved=mac_current_state;
348:systime.c **** mac_current_state=MAC_STATE_INACTIVE;
1028 .LM108:
1029 0352 8091 0000 lds r24,mac_current_state
1030 0356 8093 0000 sts mac_current_state_saved,r24
349:systime.c **** PLME_SET_TRX_STATE_request(FORCE_TRX_OFF);
1032 .LM109:
1033 035a 81E1 ldi r24,lo8(17)
1034 035c 8093 0000 sts mac_current_state,r24
350:systime.c **** //Is_received_beacon=FALSE;
1036 .LM110:
1037 0360 83E0 ldi r24,lo8(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -