def main(): cc = AvrGcc() print '--------------' print 'avr-gcc' print '--------------' print 'compiler version:', cc.version() cc.optimize_for_size() print 'compiler options:', ' '.join(cc.options_generated()) print 'code:', cc.minprog print for mcu in cc.targets: test(cc, mcu)
def main(): cc = AvrGcc() print '--------------' print 'avr-gcc' print '--------------' print 'compiler version:', cc.version() cc.optimize_for_size() print 'compiler options:', ' '.join(cc.options_generated()) print 'code:', cc.minprog print for mcu in cc.targets: test(cc, mcu)
from entrypoint2 import entrypoint templ = ''' #include <avr/io.h> #include <avr/pgmspace.h> int main() { %s; return 0; } ''' cc = AvrGcc() cc.optimization = 0 print 'compiler version:', cc.version() print 'compiler options:', ' '.join(cc.options_generated()) print def test(snippet): print snippet, '\t\t', try: cc.build([templ % snippet]) size = cc.size() print 'program, data =', str(size.program_bytes).rjust(8), ',', str(size.data_bytes).rjust(8) except: print 'compile error' def test_comb(s): words = 'static const PROGMEM'.split()
from entrypoint2 import entrypoint templ = ''' #include <avr/io.h> #include <avr/pgmspace.h> int main() { %s; return 0; } ''' cc = AvrGcc() cc.optimization = 0 print 'compiler version:', cc.version() print 'compiler options:', ' '.join(cc.options_generated()) print def test(snippet): print snippet, '\t\t', try: cc.build([templ % snippet]) size = cc.size() print 'program, data =', str(size.program_bytes).rjust(8), ',', str( size.data_bytes).rjust(8) except: print 'compile error' def test_comb(s):