File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -844,19 +844,12 @@ def set_thread_core():
844844 data = data .replace (pattern , text )
845845 break
846846
847- if '#ifdef MICROPY_TASK_STACK_SIZE' not in data :
848- new_lines = [
849- '#ifdef MICROPY_TASK_STACK_SIZE' ,
850- ' #undef MICROPY_TASK_STACK_SIZE'
851- '#endif'
852- ''
853- f'#define MICROPY_TASK_STACK_SIZE ({ task_stack_size } )'
854- ''
855- '#ifndef MICROPY_CONFIG_ROM_LEVEL'
856- ]
847+ if data .count ('#define MICROPY_TASK_STACK_SIZE' ) == 1 :
857848 data = data .replace (
858849 '#ifndef MICROPY_CONFIG_ROM_LEVEL' ,
859- '\n ' .join (new_lines ), 1 )
850+ f'#define MICROPY_TASK_STACK_SIZE '
851+ f'({ task_stack_size } )\n \n #ifndef MICROPY_CONFIG_ROM_LEVEL'
852+ )
860853 else :
861854 data = data .split ('\n ' )
862855 for i , line in enumerate (data ):
You can’t perform that action at this time.
0 commit comments