From b976c62423b60b8a373c0723c7eb3c7850458f49 Mon Sep 17 00:00:00 2001 From: pvvx Date: Fri, 10 Mar 2017 01:40:25 +0300 Subject: [PATCH] fix clk cpu --- .../component/common/mbed/common/wait_api.c | 6 +++--- build/bin/ota.bin | Bin 297772 -> 297772 bytes build/bin/ram_2.bin | Bin 297736 -> 297736 bytes build/bin/ram_2.ns.bin | Bin 297752 -> 297752 bytes build/bin/ram_2.p.bin | Bin 297752 -> 297752 bytes build/bin/ram_all.bin | Bin 342824 -> 342824 bytes project/inc/platform_autoconf.h | 2 +- 7 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RTL00_SDKV35a/component/common/mbed/common/wait_api.c b/RTL00_SDKV35a/component/common/mbed/common/wait_api.c index 174c97a..b89e548 100644 --- a/RTL00_SDKV35a/component/common/mbed/common/wait_api.c +++ b/RTL00_SDKV35a/component/common/mbed/common/wait_api.c @@ -94,14 +94,14 @@ void wait_us(int us) { // До 2.147483648 секунды! uint32_t start; #ifdef WAIT_US_USE_CYCCNT if(us < 1) return; - if (us < 255) { // G-timer resolution is ~31 us (1/32K), use DWT->CYCCNT... + if (us < 327) { // G-timer resolution is ~31 us (1/32K), use DWT->CYCCNT... if(!(DWT->CTRL & DWT_CTRL_CYCCNTENA_Msk)) { // уже включен? CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; // открыть доступ DWT->CYCCNT = 0; // обнулить и запустить DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; // запустить счет } - start = DWT->CYCCNT + us * ( PLATFORM_CLOCK / 1000000 ); - while ( ( ( int32_t )DWT->CYCCNT - start) < 0 ); + start = DWT->CYCCNT + us * (PLATFORM_CLOCK / 1000000ul); + while ((int32_t)(start - DWT->CYCCNT) > 0); } else #endif diff --git a/build/bin/ota.bin b/build/bin/ota.bin index cc54fda8f4a14ff6f8f6d173ffcf054d57c7271d..09a5ce964aada2d0ab7059f065a19455e6b82bcf 100644 GIT binary patch delta 33 pcmZ28O=!(Dp@tU57N!>FEi6}xSgua^&a(YR5less3)iL_i~#1{4I=;m delta 33 pcmZ28O=!(Dp@tU57N!>FEi6}xSXL>%=iGjyh$TRRC3oWuMgZTV4Cnv= diff --git a/build/bin/ram_2.bin b/build/bin/ram_2.bin index 708a83cae95e7390acbef095a0b22e186f1b9575..1936984b467f686e5d9e06463e4f0b8521eb0b16 100644 GIT binary patch delta 28 kcmeB}Ce$%asG)_ig{g&k3(Jurma7xKvur<6#Nr?U0HAaW5&!@I delta 28 kcmeB}Ce$%asG)_ig{g&k3(JurmQ{-HIk%rEVsVfF0Gh%IbpQYW diff --git a/build/bin/ram_2.ns.bin b/build/bin/ram_2.ns.bin index e94f8569888bfdccf33a5a6dbf4da4373b120a9d..776a70b9fddbaf49630a0394a767934ff14a23ab 100644 GIT binary patch delta 28 kcmbO+O=!k6p@tU57N!>FEi6}xSgua^&a(YR5sQNa0Hov#QUCw| delta 28 kcmbO+O=!k6p@tU57N!>FEi6}xSXL>%=iGjyh{Zty0G~1nwEzGB diff --git a/build/bin/ram_2.p.bin b/build/bin/ram_2.p.bin index ec6fb154102f05cec59f58604704c2b59ac2cb58..c1b8a1c7937628c96c7159ed15db8e1d3bc063af 100644 GIT binary patch delta 28 kcmbO+O=!k6p@tU57N!>FEi6}xSgua^&a(YR5sQNa0Hov#QUCw| delta 28 kcmbO+O=!k6p@tU57N!>FEi6}xSXL>%=iGjyh{Zty0G~1nwEzGB diff --git a/build/bin/ram_all.bin b/build/bin/ram_all.bin index 2ee8fc7a1fabd8ec8b11981b0722e04a6ba4f213..7887505a597ae0a0c81ee55ade3e3e5c007a3cd1 100644 GIT binary patch delta 30 mcmZ4SO=QJ4k%kt=7N!>F7M3lnSCm+;PWaBU{e}{2fCK=_*$glM delta 30 mcmZ4SO=QJ4k%kt=7N!>F7M3lnSCm**DZc02enW{hKmq{8CkvAR diff --git a/project/inc/platform_autoconf.h b/project/inc/platform_autoconf.h index a3420c1..dd12268 100644 --- a/project/inc/platform_autoconf.h +++ b/project/inc/platform_autoconf.h @@ -246,6 +246,6 @@ #if CPU__CLK_DIV5_3 #define PLATFORM_CLOCK (200000000ul>>CPU_CLOCK_SEL_VALUE) #else -#define PLATFORM_CLOCK (((200000000ul*5ul)/3ul)>>CPU_CLOCK_SEL_VALUE) +#define PLATFORM_CLOCK (((200000000ul*5ul)/6ul)>>CPU_CLOCK_SEL_VALUE) #endif