It looks pretty good. What is the code overhead (what is the size of an empty sketch with an ATmega328 for the target?)@ralphd
Interesting question! Actually an empty file (no setup or loop) is a valid Cosa program as there is a default (weak) definition in main.cpp. The default is the Cosa event driven blink LED sketch ;-) With only the init and main the 1.5.5 IDE reports for UNO
Sketch uses 210 bytes (0%) of program storage space. Maximum is 32,256 bytes.For ATtiny84:
Sketch uses 120 bytes (1%) of program storage space. Maximum is 8,192 bytes.Handling of the timers, Watchdog and RTC, are only done if included. The same goes for Serial. I often recommend comparing Cosa UART/IOBuffer with Arduino/Wiring HardwareSerial to illustrate the difference in style.
Cosa: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/IOStream/Driver/UART.cpp, https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/IOBuffer.hh
Arduino: https://github.com/arduino/Arduino/blob/master/hardware/arduino/cores/arduino/HardwareSerial.cpp, https://github.com/arduino/Arduino/blob/master/hardware/arduino/cores/arduino/HardwareSerial.h