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 cc54fda..09a5ce9 100644 Binary files a/build/bin/ota.bin and b/build/bin/ota.bin differ diff --git a/build/bin/ram_2.bin b/build/bin/ram_2.bin index 708a83c..1936984 100644 Binary files a/build/bin/ram_2.bin and b/build/bin/ram_2.bin differ diff --git a/build/bin/ram_2.ns.bin b/build/bin/ram_2.ns.bin index e94f856..776a70b 100644 Binary files a/build/bin/ram_2.ns.bin and b/build/bin/ram_2.ns.bin differ diff --git a/build/bin/ram_2.p.bin b/build/bin/ram_2.p.bin index ec6fb15..c1b8a1c 100644 Binary files a/build/bin/ram_2.p.bin and b/build/bin/ram_2.p.bin differ diff --git a/build/bin/ram_all.bin b/build/bin/ram_all.bin index 2ee8fc7..7887505 100644 Binary files a/build/bin/ram_all.bin and b/build/bin/ram_all.bin differ 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