@@ -51,11 +51,51 @@ def scons_patched_match_splitext(path, suffixes=None):
51
51
52
52
53
53
env .Append (
54
+ ASFLAGS = ["-x" , "assembler-with-cpp" ],
55
+
56
+ CFLAGS = [
57
+ "-std=gnu99" ,
58
+ "-Wpointer-arith" ,
59
+ "-Wno-implicit-function-declaration" ,
60
+ "-Wl,-EL" ,
61
+ "-fno-inline-functions" ,
62
+ "-nostdlib"
63
+ ],
64
+
54
65
CCFLAGS = [
66
+ "-Os" , # optimize for size
67
+ "-mlongcalls" ,
68
+ "-mtext-section-literals" ,
69
+ "-falign-functions=4" ,
70
+ "-U__STRICT_ANSI__" ,
71
+ "-ffunction-sections" ,
72
+ "-fdata-sections" ,
55
73
"-Wall"
56
74
],
57
75
76
+ CXXFLAGS = [
77
+ "-fno-rtti" ,
78
+ "-fno-exceptions" ,
79
+ "-std=c++11"
80
+ ],
81
+
82
+ LINKFLAGS = [
83
+ "-Os" ,
84
+ "-nostdlib" ,
85
+ "-Wl,--no-check-sections" ,
86
+ "-Wl,-static" ,
87
+ "-Wl,--gc-sections" ,
88
+ "-Wl,-wrap,system_restart_local" ,
89
+ "-Wl,-wrap,spi_flash_read" ,
90
+ "-u" , "app_entry" ,
91
+ "-u" , "_printf_float" ,
92
+ "-u" , "_scanf_float"
93
+ ],
94
+
58
95
CPPDEFINES = [
96
+ ("F_CPU" , "$BOARD_F_CPU" ),
97
+ "__ets__" ,
98
+ "ICACHE_FLASH" ,
59
99
("ARDUINO" , 10805 ),
60
100
("ARDUINO_BOARD" , '\\ "PLATFORMIO_%s\\ "'
61
101
% env .BoardConfig ().id .upper ()),
@@ -84,23 +124,11 @@ def scons_patched_match_splitext(path, suffixes=None):
84
124
85
125
LIBSOURCE_DIRS = [
86
126
join (FRAMEWORK_DIR , "libraries" )
87
- ],
88
-
89
- LINKFLAGS = [
90
- "-Wl,-wrap,system_restart_local" ,
91
- "-Wl,-wrap,spi_flash_read" ,
92
- "-u" , "app_entry"
93
127
]
94
128
)
95
129
96
- # remove LINKFLAGS defined in main.py and keep user custom flags
97
- try :
98
- index = env ['LINKFLAGS' ].index ("call_user_start" )
99
- if index > 0 and env ['LINKFLAGS' ][index - 1 ] == "-u" :
100
- del env ['LINKFLAGS' ][index - 1 ]
101
- env ['LINKFLAGS' ].remove ("call_user_start" )
102
- except IndexError :
103
- pass
130
+ # copy CCFLAGS to ASFLAGS (-x assembler-with-cpp mode)
131
+ env .Append (ASFLAGS = env .get ("CCFLAGS" , [])[:])
104
132
105
133
flatten_cppdefines = env .Flatten (env ['CPPDEFINES' ])
106
134
0 commit comments