/* 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