@@ -107,43 +107,26 @@ def add_defines_from_platform_def(file):
107
107
line = line .strip ()
108
108
if line .startswith ("-D" ):
109
109
defn = line [2 :].split ('=' )
110
- env .Append ( CPPDEFINES = [ (defn [0 ], defn [1 ]) ] )
110
+ if len (defn ) == 2 :
111
+ env .Append ( CPPDEFINES = [ (defn [0 ], defn [1 ]) ] )
112
+ else :
113
+ env .Append ( CPPDEFINES = [ defn [0 ] ] )
111
114
112
115
add_defines_from_platform_def (os .path .join (FRAMEWORK_DIR , "lib" , "platform_def.txt" ))
113
116
add_defines_from_platform_def (os .path .join (FRAMEWORK_DIR , "lib" , chip , "platform_def.txt" ))
117
+
114
118
env .Append (
115
119
CPPDEFINES = [
116
120
("ARDUINO" , 10810 ),
117
121
"ARDUINO_ARCH_RP2040" ,
118
122
("F_CPU" , "$BOARD_F_CPU" ),
119
123
("BOARD_NAME" , '\\ "%s\\ "' % env .subst ("$BOARD" )),
124
+ # at this point, the main.py builder script hasn't updated upload.maximum_size yet,
125
+ # so it's the original value for the full flash.
126
+ ("PICO_FLASH_SIZE_BYTES" , board .get ("upload.maximum_size" ))
120
127
]
121
128
)
122
129
123
- if chip == "rp2040" :
124
- env .Append (
125
- CPPDEFINES = [
126
- "ARM_MATH_CM0_FAMILY" ,
127
- "ARM_MATH_CM0_PLUS" ,
128
- "TARGET_RP2040" ,
129
- ("PICO_RP2040" , "1" ),
130
- # at this point, the main.py builder script hasn't updated upload.maximum_size yet,
131
- # so it's the original value for the full flash.
132
- ("PICO_FLASH_SIZE_BYTES" , board .get ("upload.maximum_size" ))
133
- ]
134
- )
135
- elif (chip == "rp2350" ) or (chip == "rp2350-riscv" ):
136
- env .Append (
137
- CPPDEFINES = [
138
- ("PICO_RP2350" , "1" ),
139
- "TARGET_RP2350" ,
140
- ("PICO_RP2350" , "1" ),
141
- # at this point, the main.py builder script hasn't updated upload.maximum_size yet,
142
- # so it's the original value for the full flash.
143
- ("PICO_FLASH_SIZE_BYTES" , board .get ("upload.maximum_size" ))
144
- ]
145
- )
146
-
147
130
if chip == "rp2040" :
148
131
toolopts = ["-march=armv6-m" , "-mcpu=cortex-m0plus" , "-mthumb" ]
149
132
elif chip == "rp2350" :
0 commit comments