From 188c9a6eb244afec1972858853dc7eabdea43e3d Mon Sep 17 00:00:00 2001
From: Davids Paskevics <davip00@mi.fu-berlin.de>
Date: Tue, 23 May 2023 16:01:01 +0200
Subject: [PATCH] Work around qemu not (yet) emulating the boot ROM's functions

---
 esp32c3/mdk.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/esp32c3/mdk.h b/esp32c3/mdk.h
index a100320..c715ac9 100644
--- a/esp32c3/mdk.h
+++ b/esp32c3/mdk.h
@@ -110,7 +110,9 @@ static inline void soc_init(void) {
   REG(C3_SYSTEM)[2] |= BIT(0) | BIT(2);
   REG(C3_SYSTEM)[22] = BIT(19) | (40U << 12) | BIT(10);
   // REG(C3_RTCCNTL)[47] = 0; // RTC_APB_FREQ_REG -> freq >> 12
+  #ifndef EMULATOR_HACKS
   ((void (*)(int)) 0x40000588)(160);  // ets_update_cpu_frequency(160)
+  #endif
 
 #if 0
   // Configure system clock timer, TRM 8.3.1, 8.9
-- 
GitLab