mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
log: Check for ISR context and use proper API to get Tick Count
This commit is contained in:
parent
b04e643bd0
commit
2966f8cb8c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user