Merge branch 'bugfix/esp_log_timestamp_v4.0' into 'release/v4.0'

Use proper API to get Tick Count is esp_log_timestamp (v4.0)

See merge request espressif/esp-idf!7719
This commit is contained in:
Mahavir Jain
2020-02-20 20:52:33 +08:00

View File

@@ -341,7 +341,9 @@ uint32_t IRAM_ATTR esp_log_timestamp()
if (base == 0 && xPortGetCoreID() == 0) {
base = esp_log_early_timestamp();
}
return base + xTaskGetTickCount() * (1000 / configTICK_RATE_HZ);
TickType_t tick_count = xPortInIsrContext() ? xTaskGetTickCountFromISR() : xTaskGetTickCount();
return base + tick_count * (1000 / configTICK_RATE_HZ);
}
#else