From ff2d9fd96c2a2c1dde8c79b06597329c7ead4629 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 17 Dec 2020 10:52:15 +0800 Subject: [PATCH] [freertos] Silence sign-conversion warning --- components/hal/esp32/include/hal/cpu_ll.h | 4 ++-- components/hal/esp32s2/include/hal/cpu_ll.h | 2 +- components/hal/esp32s3/include/hal/cpu_ll.h | 4 ++-- components/hal/include/hal/soc_hal.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/hal/esp32/include/hal/cpu_ll.h b/components/hal/esp32/include/hal/cpu_ll.h index a81483c734..f93a5e9355 100644 --- a/components/hal/esp32/include/hal/cpu_ll.h +++ b/components/hal/esp32/include/hal/cpu_ll.h @@ -29,14 +29,14 @@ extern "C" { #endif -static inline int IRAM_ATTR cpu_ll_get_core_id(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) { uint32_t id; asm volatile ( "rsr.prid %0\n" "extui %0,%0,13,1" :"=r"(id)); - return (int) id; + return id; } static inline uint32_t cpu_ll_get_cycle_count(void) diff --git a/components/hal/esp32s2/include/hal/cpu_ll.h b/components/hal/esp32s2/include/hal/cpu_ll.h index 5f44b53593..d52d4489ad 100644 --- a/components/hal/esp32s2/include/hal/cpu_ll.h +++ b/components/hal/esp32s2/include/hal/cpu_ll.h @@ -28,7 +28,7 @@ extern "C" { #endif -static inline int IRAM_ATTR cpu_ll_get_core_id(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) { return 0; } diff --git a/components/hal/esp32s3/include/hal/cpu_ll.h b/components/hal/esp32s3/include/hal/cpu_ll.h index 67890ab752..6753f60954 100644 --- a/components/hal/esp32s3/include/hal/cpu_ll.h +++ b/components/hal/esp32s3/include/hal/cpu_ll.h @@ -28,14 +28,14 @@ extern "C" { #endif -static inline int IRAM_ATTR cpu_ll_get_core_id(void) +static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void) { uint32_t id; asm volatile ( "rsr.prid %0\n" "extui %0,%0,13,1" :"=r"(id)); - return (int) id; + return id; } static inline uint32_t cpu_ll_get_cycle_count(void) diff --git a/components/hal/include/hal/soc_hal.h b/components/hal/include/hal/soc_hal.h index 74359fc97c..f39cf49f1d 100644 --- a/components/hal/include/hal/soc_hal.h +++ b/components/hal/include/hal/soc_hal.h @@ -30,7 +30,7 @@ extern "C" { #if SOC_CPU_CORES_NUM > 1 // Utility functions for multicore targets #define __SOC_HAL_PERFORM_ON_OTHER_CORES(action) { \ - for (int i = 0, cur = cpu_hal_get_core_id(); i < SOC_CPU_CORES_NUM; i++) { \ + for (uint32_t i = 0, cur = cpu_hal_get_core_id(); i < SOC_CPU_CORES_NUM; i++) { \ if (i != cur) { \ action(i); \ } \