Insert text before a line into multiple files
The stream editor sed inserts text before a specified pattern. sed -i '/pattern/i\inserted …
I can check the memory footprint using the avr-size
command.
% avr-size microcoap.cpp.elf
text data bss dec hex filename
0 18612 0 18612 48b microcoap.cpp.hex
When I enable the avr
format (-C
) and provide the microcontroller model, the output becomes more descriptive.
% avr-size -C --mcu=atmega328p microcoap.cpp.elf
AVR Memory Usage
----------------
Device: atmega328p
Program: 18612 bytes (56.8% Full)
(.text + .data + .bootloader)
Data: 2491 bytes (121.6% Full)
(.data + .bss + .noinit)