Merge branch 'feature/refactor_func_os_update_cpu_frequency' into 'master'

feat(esp8266): refactor function "os_update_cpu_frequency"

See merge request sdk/ESP8266_RTOS_SDK!1326
This commit is contained in:
Dong Heng
2020-03-05 09:46:23 +08:00
5 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,5 @@
gwen:
core: e1fe83a
core: 71005fb
net80211: e1fe83a
pp: e1fe83a
wpa: e1fe83a

Binary file not shown.

Binary file not shown.

View File

@ -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")));

View File

@ -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