avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Re: What Happened to the sbi() and cbi() Macros????


From: Ned Konz
Subject: Re: [avr-gcc-list] Re: What Happened to the sbi() and cbi() Macros????
Date: Mon, 31 Jan 2005 16:07:10 -0800
User-agent: KMail/1.7.2

On Monday 31 January 2005 2:54 pm, E. Weddington wrote:
> >Perhaps we should announce Ned Konz' Perl script.  Perl is part of
> >WinAVR anyway, so it would make it an easy move for almost anyone to
> >convert their old sources.
> >
> >  
>
> *cough* Actually no, perl is not in WinAVR. It's got gawk and sed.

OK, here's the same thing in sed:

# run with:
# /bin/sed -f rewriteCbiAndSbi.sed -i.bak file [...]
s/\([  ]*\)cbi[  ]*([  ]*\([^,)]\+\)[  ]*,[  ]*\([^,)]\+\)[  ]*)/\1\2 \&= 
~BIT(\3)/g
s/\([  ]*\)sbi[  ]*([  ]*\([^,)]\+\)[  ]*,[  ]*\([^,)]\+\)[  ]*)/\1\2 |= 
BIT(\3)/g


-- 
Ned Konz
http://bike-nomad.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]