File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -834,6 +834,28 @@ def compile(): # NOQA
834
834
with open (board_config_path , 'w' ) as f :
835
835
f .write ('\n ' .join (base_config ))
836
836
837
+ if board == 'ESP32_GENERIC' and board_variant and board_variant == 'SPIRAM' :
838
+ mpconfigport = 'lib/micropython/ports/esp32/mpconfigport.h'
839
+
840
+ with open (mpconfigport , 'rb' ) as f :
841
+ data = f .read ().decode ('utf-8' )
842
+
843
+ pattern = (
844
+ '#if !(CONFIG_IDF_TARGET_ESP32 && CONFIG_SPIRAM && CONFIG_SPIRAM_CACHE_WORKAROUND)\n '
845
+ '#define MICROPY_WRAP_MP_BINARY_OP(f) IRAM_ATTR f\n '
846
+ '#endif'
847
+ )
848
+
849
+ if pattern in data :
850
+ pattern = '#if !(CONFIG_IDF_TARGET_ESP32 && CONFIG_SPIRAM && CONFIG_SPIRAM_CACHE_WORKAROUND)\n '
851
+ data = data .replace ('#define MICROPY_WRAP_MP_SCHED_EXCEPTION(f) IRAM_ATTR f\n ' , '' )
852
+ data = data .replace ('#define MICROPY_WRAP_MP_SCHED_KEYBOARD_INTERRUPT(f) IRAM_ATTR f\n ' , '' )
853
+
854
+ data = data .replace (pattern , pattern + '#define MICROPY_WRAP_MP_SCHED_EXCEPTION(f) IRAM_ATTR f\n ' )
855
+ data = data .replace (pattern , pattern + '#define MICROPY_WRAP_MP_SCHED_KEYBOARD_INTERRUPT(f) IRAM_ATTR f\n ' )
856
+ with open (mpconfigport , 'rb' ) as f :
857
+ f .write (data .encode ('utf-8' ))
858
+
837
859
if board in ('ESP32_GENERIC_S2' , 'ESP32_GENERIC_S3' ) and disable_OTG :
838
860
mphalport_path = 'lib/micropython/ports/esp32/mphalport.c'
839
861
You can’t perform that action at this time.
0 commit comments