Advanced Distributed Systems module at HSLU
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
ADIS_Projects/McuLib/src/McuWaitIAR.s.txt

29 lines
1.0 KiB

/* NOTE: because the IAR compiler cannot handle inline assembly with labels,
* this assembly file has to be included for IAR projects.
* If this file is provided with .s.txt extension:
* Remove the .txt extension and build it with the IAR project.
*/
/* use code segment, and we are generating ARM thumb code: */
RSEG CODE:CODE(2)
thumb
/* external interface declaration; */
PUBLIC McuWait_Wait100Cycles
/*-----------------------------------------------------------*/
McuWait_Wait100Cycles:
/* bl to here: [4] */
movs r0,#0 /* [1] load loop counter */
loop: /* 9*[10] */
nop /* [1] */
nop /* [1] */
nop /* [1] */
nop /* [1] */
nop /* [1] */
adds r0,#1 /* [1] increment loop counter */
cmp r0,#9 /* [1] 9*10 cycles */
bls loop /* [3] for taken, [1] for not taken */
nop /* additional nop to fill up to 100 cycles */
bx lr /* return to caller */
/*-----------------------------------------------------------*/
END