Sfoglia il codice sorgente

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
Mahavir Jain 6 anni fa
parent
commit
54f7ed5dcc
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      components/log/log.c

+ 3 - 1
components/log/log.c

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