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

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

See merge request espressif/esp-idf!7717
This commit is contained in:
Mahavir Jain 2020-02-20 21:11:10 +08:00
commit 0809136836

View file

@ -99,7 +99,8 @@ uint32_t esp_log_timestamp(void)
if (base == 0 && xPortGetCoreID() == 0) { if (base == 0 && xPortGetCoreID() == 0) {
base = esp_log_early_timestamp(); 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);
} }
/* FIXME: define an API for getting the timestamp in soc/hal */ /* FIXME: define an API for getting the timestamp in soc/hal */