From: Enoch <ix...@ho...> - 2012-10-08 20:58:59
|
Hi Matthias, Please find attached a patch to Keith's shell script for your consideration. I took the lazy approach of using Python's eval() option and it was quite easy: Two variables: avr - device name string py - a truth value 1st method: #py= avr=="at90can128" #py? "%00000000 TCCR0 c!" if py else "%00000000 TCCR0B c!" 2nd method: #py= TCCR0B #py? "%00000000 TCCR0B c!" if py else "%00000000 TCCR0 c!" If TCCR0B is a known register name py is True, if not py is False (taking advantage of Keith's reg name substitutions). Please comment. Thank you, Enoch. On 10/08/2012 01:36 PM, Matthias Trute wrote: > Hi, > >> On the at90can128, for example, one has to introduce "TCCR0 constant >> TCCR0B" before uploading lib/hardware/time0.frt >> >> How about extending Keith's fantastic shell with conditional upload >> constructs such as: >> >> #ifdev at90can128 >> %00000000 TCCR0 c! \ stop timer >> #else >> %00000000 TCCR0B c! \ stop timer >> #endif > > There are a few (~15 IIRC) more devices, that > suffer the same problem. Your solution does > not scale enough, unfortuatly. > >> Any better idea? > > Highly appricated! > > I considered something like > > #ifndef TCCR0B > #define TCCR0B TCCR0 > #endif > > but who wants to maintain the matching rules? And who > wants to check _in detail_ if they are really compatible > with each other for every controller type (~120 by now)? > I wont do it. > > Matthias > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: patch |