From 7d2d54a94dc96e9710ff6abfa7907135ada73463 Mon Sep 17 00:00:00 2001 From: Zatupitel Date: Fri, 24 Jan 2025 14:35:44 +0300 Subject: [PATCH] Fix working on ESP32-S3 (#8) Disable brown-out detector in a more correct way: clear only enable bit instead of clearing the whole register. --------- Co-authored-by: Oleg Kalachev --- flix/util.h | 2 +- gazebo/soc/soc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flix/util.h b/flix/util.h index 8444aaf..a46c034 100644 --- a/flix/util.h +++ b/flix/util.h @@ -40,5 +40,5 @@ void printArray(const T (&arr)[N]) { // Disable reset on low voltage void disableBrownOut() { - WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); + REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ENA); } diff --git a/gazebo/soc/soc.h b/gazebo/soc/soc.h index f4bdec2..2d3f1e2 100644 --- a/gazebo/soc/soc.h +++ b/gazebo/soc/soc.h @@ -1,3 +1,4 @@ // Dummy file to make it possible to compile simulator with Flix' util.h #define WRITE_PERI_REG(addr, val) {} +#define REG_CLR_BIT(_r, _b) {}