Skip to content

Commit

Permalink
esp32s2: fix left shift runtime errors
Browse files Browse the repository at this point in the history
  • Loading branch information
erhankur committed Jan 31, 2021
1 parent db13a11 commit 7c87f2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/target/esp32s2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7c87f2f

Please sign in to comment.