Sfoglia il codice sorgente

freertos: implement get core id with cpu abstraction

Renz Christian Bagaporo 6 anni fa
parent
commit
db608736fb
1 ha cambiato i file con 4 aggiunte e 7 eliminazioni
  1. 4 7
      components/freertos/include/freertos/portable.h

+ 4 - 7
components/freertos/include/freertos/portable.h

@@ -86,7 +86,6 @@ specific constants has been moved into the deprecated_definitions.h header
 file. */
 #include "deprecated_definitions.h"
 
-#include "soc/cpu.h"
 
 /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
 did not result in a portmacro.h header file being included - and it should be
@@ -127,6 +126,9 @@ extern "C" {
 #include "mpu_wrappers.h"
 #include "esp_system.h"
 
+#include "hal/cpu_hal.h"
+#include "xt_instr_macros.h"
+
 /*
  * Setup the stack of a new task so it is ready to be placed under the
  * scheduler control.  The registers have to be placed on the stack in
@@ -200,12 +202,7 @@ BaseType_t xPortInterruptedFromISRContext(void);
 
 /* Multi-core: get current core ID */
 static inline uint32_t IRAM_ATTR xPortGetCoreID(void) {
-    uint32_t id;
-    __asm__ __volatile__ (
-        "rsr.prid %0\n"
-        " extui %0,%0,13,1"
-        :"=r"(id));
-    return id;
+    return cpu_hal_get_core_id();
 }
 
 /* Get tick rate per second */