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: E. Weddington
Subject: Re: [avr-gcc-list] Re: What Happened to the sbi() and cbi() Macros????
Date: Mon, 31 Jan 2005 17:10:04 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Ned Konz wrote:

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


s/BIT/_BV/g





reply via email to

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