From 7c87f2f0273adedb1f5720717752fd00e9363318 Mon Sep 17 00:00:00 2001 From: erhan Date: Sun, 31 Jan 2021 16:45:17 +0300 Subject: [PATCH] esp32s2: fix left shift runtime errors --- src/target/esp32s2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target/esp32s2.c b/src/target/esp32s2.c index 376b3a62c9..57d4a7b8ef 100644 --- a/src/target/esp32s2.c +++ b/src/target/esp32s2.c @@ -86,7 +86,7 @@ #define ESP32_S2_SW_CPU_STALL (ESP32_S2_RTCCNTL_BASE + 0x00B8) #define ESP32_S2_SW_STALL_PROCPU_C1_M ((ESP32_S2_SW_STALL_PROCPU_C1_V)<< \ (ESP32_S2_SW_STALL_PROCPU_C1_S)) -#define ESP32_S2_SW_STALL_PROCPU_C1_V 0x3F +#define ESP32_S2_SW_STALL_PROCPU_C1_V 0x3FU #define ESP32_S2_SW_STALL_PROCPU_C1_S 26 #define ESP32_S2_CLK_CONF (ESP32_S2_RTCCNTL_BASE + 0x0074) #define ESP32_S2_CLK_CONF_DEF 0x1583218 @@ -326,7 +326,7 @@ static int esp32s2_stall_set(struct target *target, bool stall) int res = esp_xtensa_set_peri_reg_mask(target, ESP32_S2_SW_CPU_STALL, ESP32_S2_SW_STALL_PROCPU_C1_M, - stall ? 0x21 << ESP32_S2_SW_STALL_PROCPU_C1_S : 0); + stall ? 0x21U << ESP32_S2_SW_STALL_PROCPU_C1_S : 0); if (res != ERROR_OK) { LOG_ERROR("Failed to write ESP32_S2_SW_CPU_STALL (%d)!", res); return res; @@ -452,7 +452,7 @@ static int esp32s2_soc_reset(struct target *target) res = esp_xtensa_set_peri_reg_mask(target, ESP32_S2_OPTIONS0, ESP32_S2_SW_SYS_RST_M, - 1 << ESP32_S2_SW_SYS_RST_S); + 1U << ESP32_S2_SW_SYS_RST_S); xtensa->suppress_dsr_errors = false; if (res != ERROR_OK) { LOG_ERROR("Failed to write ESP32_S2_OPTIONS0 (%d)!", res);