diff --git a/components/esp8266/lib/VERSION b/components/esp8266/lib/VERSION index f97de66c..87e5b6db 100644 --- a/components/esp8266/lib/VERSION +++ b/components/esp8266/lib/VERSION @@ -1,5 +1,5 @@ gwen: - core: e1fe83a + core: 71005fb net80211: e1fe83a pp: e1fe83a wpa: e1fe83a diff --git a/components/esp8266/lib/libcore.a b/components/esp8266/lib/libcore.a index d8eda7af..597190a9 100755 Binary files a/components/esp8266/lib/libcore.a and b/components/esp8266/lib/libcore.a differ diff --git a/components/esp8266/lib/libcore_dbg.a b/components/esp8266/lib/libcore_dbg.a index 2a3fbce3..c3a01aa9 100755 Binary files a/components/esp8266/lib/libcore_dbg.a and b/components/esp8266/lib/libcore_dbg.a differ diff --git a/components/esp8266/source/system_api.c b/components/esp8266/source/system_api.c index c3c0402c..f464446a 100644 --- a/components/esp8266/source/system_api.c +++ b/components/esp8266/source/system_api.c @@ -32,6 +32,7 @@ static const char* TAG = "system_api"; static uint8_t base_mac_addr[6] = { 0 }; +uint32_t g_esp_ticks_per_us = 80; // Bootloader can get this information const __attribute__((section(".SystemInfoVector.text"))) esp_sys_info_t g_esp_sys_info = { @@ -366,3 +367,18 @@ uint32_t esp_get_old_sysconf_addr(void) { return rtc_sys_info.old_sysconf_addr; } + +void os_update_cpu_frequency(uint32_t ticks_per_us) +{ + extern uint32_t _xt_tick_divisor; + + if (REG_READ(DPORT_CTL_REG) & DPORT_CTL_DOUBLE_CLK) { + g_esp_ticks_per_us = CPU_CLK_FREQ * 2 / 1000000; + _xt_tick_divisor = (CPU_CLK_FREQ * 2 / CONFIG_FREERTOS_HZ); + } else { + g_esp_ticks_per_us = CPU_CLK_FREQ / 1000000;; + _xt_tick_divisor = (CPU_CLK_FREQ / CONFIG_FREERTOS_HZ); + } +} + +void ets_update_cpu_frequency(uint32_t ticks_per_us) __attribute__((alias("os_update_cpu_frequency"))); diff --git a/components/freertos/port/esp8266/include/freertos/portmacro.h b/components/freertos/port/esp8266/include/freertos/portmacro.h index 5d24707d..2955f9d2 100644 --- a/components/freertos/port/esp8266/include/freertos/portmacro.h +++ b/components/freertos/port/esp8266/include/freertos/portmacro.h @@ -213,7 +213,7 @@ void esp_increase_tick_cnt(const TickType_t ticks); extern void esp_vApplicationIdleHook( void ); extern void esp_vApplicationTickHook( void ); -extern const uint32_t g_esp_ticks_per_us; +extern uint32_t g_esp_ticks_per_us; /* * @brief Get FreeRTOS system idle ticks