21
21
import re
22
22
from os .path import join
23
23
24
- from SCons .Script import (COMMAND_LINE_TARGETS , AlwaysBuild , Builder , Default ,
25
- DefaultEnvironment )
24
+ from SCons .Script import (ARGUMENTS , COMMAND_LINE_TARGETS , AlwaysBuild ,
25
+ Builder , Default , DefaultEnvironment )
26
26
27
27
28
28
def _get_flash_size (env ):
@@ -151,7 +151,7 @@ def _get_board_f_flash(env):
151
151
ASFLAGS = env .get ("CCFLAGS" , [])[:]
152
152
)
153
153
154
- if not env . GetOption ( "silent" ):
154
+ if int ( ARGUMENTS . get ( "PIOVERBOSE" , 0 ) ):
155
155
env .Prepend (UPLOADERFLAGS = ["-vv" ])
156
156
157
157
@@ -189,14 +189,14 @@ def _fetch_spiffs_size(target, source, env):
189
189
env .Append (
190
190
BUILDERS = dict (
191
191
DataToBin = Builder (
192
- action = " " .join ([
192
+ action = env . VerboseAction ( " " .join ([
193
193
'"$MKSPIFFSTOOL"' ,
194
194
"-c" , "$SOURCES" ,
195
195
"-p" , "${int(SPIFFS_PAGE, 16)}" ,
196
196
"-b" , "${int(SPIFFS_BLOCK, 16)}" ,
197
197
"-s" , "${int(SPIFFS_END, 16) - int(SPIFFS_START, 16)}" ,
198
198
"$TARGET"
199
- ]),
199
+ ]), "Building SPIFFS image from '$SOURCES' directory to $TARGET" ),
200
200
emitter = _fetch_spiffs_size ,
201
201
source_factory = env .Dir ,
202
202
suffix = ".bin"
@@ -223,7 +223,7 @@ def _fetch_spiffs_size(target, source, env):
223
223
224
224
BUILDERS = dict (
225
225
ElfToBin = Builder (
226
- action = " " .join ([
226
+ action = env . VerboseAction ( " " .join ([
227
227
'"$OBJCOPY"' ,
228
228
"-eo" ,
229
229
'"%s"' % join ("$FRAMEWORK_ARDUINOESP8266_DIR" ,
@@ -241,7 +241,7 @@ def _fetch_spiffs_size(target, source, env):
241
241
"-bs" , ".data" ,
242
242
"-bs" , ".rodata" ,
243
243
"-bc" , "-ec"
244
- ]),
244
+ ]), "Building $TARGET" ),
245
245
suffix = ".bin"
246
246
)
247
247
)
@@ -270,7 +270,7 @@ def _fetch_spiffs_size(target, source, env):
270
270
271
271
BUILDERS = dict (
272
272
ElfToBin = Builder (
273
- action = " " .join ([
273
+ action = env . VerboseAction ( " " .join ([
274
274
'"$OBJCOPY"' ,
275
275
"-eo" , "$SOURCES" ,
276
276
"-bo" , "${TARGETS[0]}" ,
@@ -284,7 +284,7 @@ def _fetch_spiffs_size(target, source, env):
284
284
"-eo" , "$SOURCES" ,
285
285
"-es" , ".irom0.text" , "${TARGETS[1]}" ,
286
286
"-ec" , "-v"
287
- ]),
287
+ ]), "Building $TARGET" ),
288
288
suffix = ".bin"
289
289
)
290
290
)
@@ -345,7 +345,9 @@ def _fetch_spiffs_size(target, source, env):
345
345
# Target: Print binary size
346
346
#
347
347
348
- target_size = env .Alias ("size" , target_elf , "$SIZEPRINTCMD" )
348
+ target_size = env .Alias (
349
+ "size" , target_elf ,
350
+ env .VerboseAction ("$SIZEPRINTCMD" , "Calculating size $SOURCE" ))
349
351
AlwaysBuild (target_size )
350
352
351
353
#
@@ -354,17 +356,13 @@ def _fetch_spiffs_size(target, source, env):
354
356
355
357
target_upload = env .Alias (
356
358
["upload" , "uploadlazy" , "uploadfs" ], target_firm ,
357
- [env .AutodetectUploadPort , "$UPLOADCMD" ])
359
+ [env .VerboseAction (env .AutodetectUploadPort , "Looking for upload port..." ),
360
+ env .VerboseAction ("$UPLOADCMD" , "Uploading $SOURCE" )])
358
361
env .AlwaysBuild (target_upload )
359
362
360
- #
361
- # Target: Unit Testing
362
- #
363
-
364
- AlwaysBuild (env .Alias ("test" , [target_firm , target_size ]))
365
363
366
364
#
367
- # Target: Define targets
365
+ # Default targets
368
366
#
369
367
370
368
Default ([target_firm , target_size ])
0 commit comments