def main(): cc = AvrGcc() print '--------------' print 'avr-gcc' print '--------------' print 'compiler version:', cc.version() cc.optimize_for_size() print for mcu in cc.targets: print 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 from pyavrutils.avrgcc import AvrGcc, AvrGccCompileError templ = ''' #include <avr/io.h> #include <util/delay.h> int main() { %s; return 0; } ''' cc = AvrGcc() cc.optimize_no() print 'compiler version:', cc.version() print def test(snippet, option=''): print snippet.ljust(33), cc.options_extra = option.split() print 'compiler option:', option, '\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 AvrGccCompileError: print 'compile error'
from entrypoint2 import entrypoint from pyavrutils.avrgcc import AvrGcc, AvrGccCompileError templ = ''' #include <avr/io.h> #include <util/delay.h> int main() { %s; return 0; } ''' cc = AvrGcc() cc.optimize_no() print 'compiler version:', cc.version() print def test(snippet, option=''): print snippet.ljust(33), cc.options_extra = option.split() print 'compiler option:', option, '\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 AvrGccCompileError: print 'compile error'