Skip to content

Commit e1a9903

Browse files
committed
new board generator option: --nofloat
1 parent 4e539b2 commit e1a9903

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

platform.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ build.lwip_lib=-llwip_gcc
2121
build.lwip_include=lwip/include
2222
build.lwip_flags=-DLWIP_OPEN_SRC
2323

24+
build.float=-u _printf_float -u _scanf_float
2425
build.led=
2526

2627
compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
@@ -34,7 +35,7 @@ compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implici
3435
compiler.S.cmd=xtensa-lx106-elf-gcc
3536
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
3637

37-
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
38+
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
3839

3940
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
4041
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lairkiss -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc

tools/boards.txt.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,7 @@ def all_debug ():
924924
listcomb = [ 'SSL', 'TLS_MEM', 'HTTP_CLIENT', 'HTTP_SERVER' ]
925925
listnocomb = [ 'CORE', 'WIFI', 'HTTP_UPDATE', 'UPDATER', 'OTA' ]
926926
listsingle = [ 'NoAssert-NDEBUG' ]
927-
if not premerge:
928-
listnocomb += [ 'OOM -include "umm_malloc/umm_malloc_cfg.h"' ]
927+
listnocomb += [ 'OOM -include "umm_malloc/umm_malloc_cfg.h"' ]
929928
options = combn(listcomb)
930929
options += comb1(listnocomb)
931930
options += [ listcomb + listnocomb ]
@@ -1091,10 +1090,7 @@ def all_boards ():
10911090

10921091
macros.update(all_flash_size())
10931092
macros.update(all_debug())
1094-
if premerge:
1095-
macros.update({ 'led': { } })
1096-
else:
1097-
macros.update(led(led_default, led_max))
1093+
macros.update(led(led_default, led_max))
10981094

10991095
print '#'
11001096
print '# this file is script-generated and is likely to be overwritten by ' + sys.argv[0]
@@ -1148,6 +1144,9 @@ def all_boards ():
11481144
if not ('opts' in board) or not (optname in board['opts']):
11491145
print id + optname + '=' + macros[block][optname]
11501146

1147+
if nofloat:
1148+
print id + '.build.float='
1149+
11511150
print ''
11521151

11531152
if boardsgen:
@@ -1243,8 +1242,8 @@ def usage (name,ret):
12431242
print " --led - preferred default builtin led for generic boards (default %d)" % led_default
12441243
print " --board b - board to modify:"
12451244
print " --speed s - change default serial speed"
1246-
print " --premerge - no OOM debug option, no led menu"
12471245
print " --customspeed s - new serial speed for all boards"
1246+
print " --nofloat - disable float support in printf/scanf"
12481247
print ""
12491248
print " mandatory option (at least one):"
12501249
print ""
@@ -1285,7 +1284,7 @@ def usage (name,ret):
12851284
default_speed = '115'
12861285
led_default = 2
12871286
led_max = 16
1288-
premerge = False
1287+
nofloat = False
12891288
ldgen = False
12901289
ldshow = False
12911290
boardsgen = False
@@ -1300,7 +1299,7 @@ def usage (name,ret):
13001299

13011300
try:
13021301
opts, args = getopt.getopt(sys.argv[1:], "h",
1303-
[ "help", "premerge", "lwip=", "led=", "speed=", "board=", "customspeed=",
1302+
[ "help", "lwip=", "led=", "speed=", "board=", "customspeed=", "nofloat",
13041303
"ld", "ldgen", "boards", "boardsgen", "package", "packagegen", "doc", "docgen" ])
13051304
except getopt.GetoptError as err:
13061305
print str(err) # will print something like "option -a not recognized"
@@ -1314,9 +1313,6 @@ def usage (name,ret):
13141313
if o in ("-h", "--help"):
13151314
usage(sys.argv[0], 0)
13161315

1317-
elif o in ("--premerge"):
1318-
premerge = True
1319-
13201316
elif o in ("--lwip"):
13211317
lwip = a
13221318

@@ -1343,6 +1339,9 @@ def usage (name,ret):
13431339
usage(sys.argv[0], 1)
13441340
boards[board]['serial'] = a
13451341

1342+
elif o in ("--nofloat"):
1343+
nofloat=True
1344+
13461345
elif o in ("--ldshow"):
13471346
ldshow = True
13481347

0 commit comments

Comments
 (0)