|
66 | 66 | env.Append(CPPDEFINES=["USB_SERIAL"]) |
67 | 67 |
|
68 | 68 | env.Replace( |
69 | | - SIZEPROGREGEXP=r"^(?:\.text|\.text\.progmem|\.text\.itcm|\.data)\s+([0-9]+).*", |
| 69 | + SIZEPROGREGEXP=r"^(?:\.text|\.text\.progmem|\.text\.itcm|\.data|\.text\.csf)\s+([0-9]+).*", |
70 | 70 | SIZEDATAREGEXP=r"^(?:\.usbdescriptortable|\.dmabuffers|\.usbbuffers|\.data|\.bss|\.noinit|\.text\.itcm|\.text\.itcm\.padding)\s+([0-9]+).*" |
71 | 71 | ) |
72 | 72 |
|
|
157 | 157 | "-Wl,--gc-sections,--relax", |
158 | 158 | "-mthumb", |
159 | 159 | "-mcpu=%s" % env.BoardConfig().get("build.cpu"), |
160 | | - "-Wl,--defsym=__rtc_localtime=$UNIX_TIME", |
161 | | - "-fsingle-precision-constant" |
| 160 | + "-Wl,--defsym=__rtc_localtime=$UNIX_TIME" |
162 | 161 | ], |
163 | 162 |
|
164 | 163 | LIBS=["m", "stdc++"] |
|
167 | 166 | if not env.BoardConfig().get("build.ldscript", ""): |
168 | 167 | env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", "")) |
169 | 168 |
|
170 | | - if env.BoardConfig().id_ in ("teensy35", "teensy36", "teensy40", "teensy41"): |
| 169 | + if env.BoardConfig().id_ in ( |
| 170 | + "teensy35", |
| 171 | + "teensy36", |
| 172 | + "teensy40", |
| 173 | + "teensy41", |
| 174 | + "teensymm", |
| 175 | + ): |
171 | 176 | fpv_version = "4-sp" |
172 | | - if env.BoardConfig().id_.startswith("teensy4"): |
| 177 | + if env.BoardConfig().id_.startswith(("teensy4", "teensymm")): |
173 | 178 | fpv_version = "5" |
| 179 | + env.Append(CXXFLAGS=["-fno-threadsafe-statics"]) |
174 | 180 |
|
175 | 181 | env.Append( |
176 | 182 | CCFLAGS=[ |
|
262 | 268 | LINKFLAGS=["-O2"] |
263 | 269 | ) |
264 | 270 |
|
265 | | -env.Append( |
266 | | - ASFLAGS=env.get("CCFLAGS", [])[:] |
267 | | -) |
268 | 271 |
|
269 | | -if "cortex-m" in env.BoardConfig().get("build.cpu", ""): |
| 272 | +cpu = env.BoardConfig().get("build.cpu", "") |
| 273 | +if "cortex-m" in cpu: |
270 | 274 | board = env.subst("$BOARD") |
271 | 275 | math_lib = "arm_cortex%s_math" |
272 | 276 | if board in ("teensy35", "teensy36"): |
273 | 277 | math_lib = math_lib % "M4lf" |
274 | 278 | elif board in ("teensy30", "teensy31"): |
275 | 279 | math_lib = math_lib % "M4l" |
276 | | - elif board.startswith("teensy4"): |
| 280 | + elif board.startswith(("teensy4", "teensymm")): |
277 | 281 | math_lib = math_lib % "M7lfsp" |
278 | 282 | else: |
279 | 283 | math_lib = math_lib % "M0l" |
280 | 284 |
|
281 | 285 | env.Prepend(LIBS=[math_lib]) |
282 | 286 |
|
| 287 | + if cpu.startswith(("cortex-m4", "cortex-m0")): |
| 288 | + env.Append( |
| 289 | + CCFLAGS=[ |
| 290 | + "-mno-unaligned-access", |
| 291 | + "-fsingle-precision-constant" |
| 292 | + ], |
| 293 | + |
| 294 | + LINKFLAGS=[ |
| 295 | + "-fsingle-precision-constant" |
| 296 | + ] |
| 297 | + ) |
| 298 | + |
| 299 | +env.Append( |
| 300 | + ASFLAGS=env.get("CCFLAGS", [])[:] |
| 301 | +) |
| 302 | + |
283 | 303 | # Teensy 2.x Core |
284 | 304 | if BUILD_CORE == "teensy": |
285 | 305 | env.Append(CPPPATH=[join(FRAMEWORK_DIR, "cores")]) |
|
0 commit comments