Fix nsleep100 on STM32

CL: Fix nsleep100 on STM32

PUBLISHED_FROM=cabb98a0541bac9bb66bfa702d54bf8ff20063e7
This commit is contained in:
Deomid Ryabkov 2019-01-08 19:56:19 +00:00 committed by Cesanta Bot
parent e9a8e5468d
commit c2a10601b9
2 changed files with 12 additions and 0 deletions

View File

@ -26,7 +26,11 @@
.global mgos_nsleep100_impl .global mgos_nsleep100_impl
.global mgos_nsleep100_loop_count .global mgos_nsleep100_loop_count
#ifdef STM32
.section .RamFunc.mgos_nsleep100_impl
#else
.section .iram.mgos_nsleep100_impl .section .iram.mgos_nsleep100_impl
#endif
.type mgos_nsleep100_impl, %function .type mgos_nsleep100_impl, %function
.align 4 .align 4
@ -34,7 +38,11 @@ mgos_nsleep100_impl:
ldr r3, =mgos_nsleep100_loop_count ldr r3, =mgos_nsleep100_loop_count
ldr r3, [r3] ldr r3, [r3]
mul r0, r3 mul r0, r3
#ifdef STM32L4
mov r1, #3
#else
mov r1, #6 mov r1, #6
#endif
udiv r0, r0, r1 udiv r0, r0, r1
cbz r0, xxx cbz r0, xxx
lxx: lxx:

View File

@ -26,7 +26,11 @@
.global mgos_nsleep100_impl .global mgos_nsleep100_impl
.global mgos_nsleep100_loop_count .global mgos_nsleep100_loop_count
#ifdef STM32
.section .RamFunc.mgos_nsleep100_impl
#else
.section .iram.mgos_nsleep100_impl .section .iram.mgos_nsleep100_impl
#endif
.type mgos_nsleep100_impl, %function .type mgos_nsleep100_impl, %function
.align 4 .align 4