@@ -618,9 +618,9 @@ def generate_table(self, file_desc):
618
618
output += "Total Flash memory (text + data): %s bytes\n " % \
619
619
str (self .mem_summary ['total_flash' ])
620
620
621
- return output
621
+ return output . strip ()
622
622
623
- def generate_bars (self , file_desc , device_name = None ):
623
+ def generate_bars (self , file_desc , device_name = None , show_totals = False ):
624
624
""" Generates nice looking bars that represent the memory consumption
625
625
626
626
Returns: string containing nice looking bars
@@ -663,10 +663,12 @@ def unit(n, u='B', p=3):
663
663
scale = math .floor (math .log (n , 1024 ))
664
664
return '{1:.{0}g}{2}{3}' .format (p , n / (1024 ** scale ), PREFIXES [int (scale )], u )
665
665
666
- usage = "Text {} Data {} BSS {}" .format (unit (text ), unit (data ), unit (bss ))
667
- avail = "ROM {} RAM {}" .format (unit (rom_used ), unit (ram_used ))
668
- output = ["{0} {1:>{2}}" .format (usage , avail ,
669
- abs (WIDTH - len (usage )- 1 ) if device_name is not None else 0 )]
666
+ output = []
667
+ if show_totals :
668
+ usage = "Text {} Data {} BSS {}" .format (unit (text ), unit (data ), unit (bss ))
669
+ avail = "ROM {} RAM {}" .format (unit (rom_used ), unit (ram_used ))
670
+ output .append ("{0} {1:>{2}}" .format (usage , avail ,
671
+ abs (WIDTH - len (usage )- 1 ) if device_name is not None else 0 ))
670
672
671
673
if device_name is not None :
672
674
for region , avail , uses in [
0 commit comments