diff --git a/src/common/platforms/arm/arm_nsleep100_m4.S b/src/common/platforms/arm/arm_nsleep100_m4.S index d40820f6..afb596fa 100644 --- a/src/common/platforms/arm/arm_nsleep100_m4.S +++ b/src/common/platforms/arm/arm_nsleep100_m4.S @@ -26,7 +26,11 @@ .global mgos_nsleep100_impl .global mgos_nsleep100_loop_count +#ifdef STM32 +.section .RamFunc.mgos_nsleep100_impl +#else .section .iram.mgos_nsleep100_impl +#endif .type mgos_nsleep100_impl, %function .align 4 @@ -34,7 +38,11 @@ mgos_nsleep100_impl: ldr r3, =mgos_nsleep100_loop_count ldr r3, [r3] mul r0, r3 +#ifdef STM32L4 + mov r1, #3 +#else mov r1, #6 +#endif udiv r0, r0, r1 cbz r0, xxx lxx: diff --git a/src/common/platforms/arm/arm_nsleep100_m7.S b/src/common/platforms/arm/arm_nsleep100_m7.S index c0e8f490..36c878fd 100644 --- a/src/common/platforms/arm/arm_nsleep100_m7.S +++ b/src/common/platforms/arm/arm_nsleep100_m7.S @@ -26,7 +26,11 @@ .global mgos_nsleep100_impl .global mgos_nsleep100_loop_count +#ifdef STM32 +.section .RamFunc.mgos_nsleep100_impl +#else .section .iram.mgos_nsleep100_impl +#endif .type mgos_nsleep100_impl, %function .align 4