diff --git a/cpu/esp32/startup.c b/cpu/esp32/startup.c index 3f08a1d659..2f5bb48fe1 100644 --- a/cpu/esp32/startup.c +++ b/cpu/esp32/startup.c @@ -228,6 +228,7 @@ static void IRAM system_clk_init (void) rtc_select_slow_clk(RTC_SLOW_FREQ_32K_XTAL); #else /* set SLOW_CLK to internal low power clock of 150 kHz */ + rtc_clk_32k_enable(false); rtc_select_slow_clk(RTC_SLOW_FREQ_RTC); #endif diff --git a/cpu/esp_common/periph/i2c_sw.c b/cpu/esp_common/periph/i2c_sw.c index 1ced515f05..0c96435a60 100644 --- a/cpu/esp_common/periph/i2c_sw.c +++ b/cpu/esp_common/periph/i2c_sw.c @@ -54,8 +54,8 @@ #define I2C_CLOCK_STRETCH 200 /* gpio access macros */ -#define GPIO_SET(l,h,b) if (b < 32) GPIO.l = BIT(b); else GPIO.h.val = BIT(32-b) -#define GPIO_GET(l,h,b) ((b < 32) ? GPIO.l & BIT(b) : GPIO.h.val & BIT(32-b)) +#define GPIO_SET(l,h,b) if (b < 32) GPIO.l = BIT(b); else GPIO.h.val = BIT(b-32) +#define GPIO_GET(l,h,b) ((b < 32) ? GPIO.l & BIT(b) : GPIO.h.val & BIT(b-32)) #else /* MCU_ESP32 */