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

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

Fw: [avr-gcc-list] AVR UART as ANSI Terminal Interface


From: Royce & Sharal Pereira
Subject: Fw: [avr-gcc-list] AVR UART as ANSI Terminal Interface
Date: Sun, 31 Oct 2004 00:27:18 +0530

Hi Jani,
----- Original Message -----
From: "Jani Rastas" <address@hidden>

> IAR. How should the code be modified in order to be compiled on WinAVR?
> Or is there code example for terminal emulator interface for AVR UART
> for WinAVR?
-----------------------------
I had a similar issue when I tried to port some code written for SDCC & the
AT89c51 to an ATMega8.

for example, the declaration  "bit flg_key, flg_ZCD;" & consequently
"flg_key=1;" and "flg_key=0", etc had to be converted to avr-gcc
format.Besides, AVR has no 'bit' storage space like AT89c51.

So I did this: replaced "bit flg_key;" with
unsigned char flags;
#define flg_key  (1<<0)
#define flg_ZCD  (1<<1)  //etc etc,

Then using my editors search/replace tool I replaced all instances of
"flg_key=1;" with "flags |= flg_key" and "flg_key=0;" with "flags &=
~flg_key;"
Also logical stuff like "if(flg_key)" etc was replaced with "if(flags &
flg_key);"

So, the point is, you'll just have do similar stuff. There's no readymade
solution. refer to the AVR-libc document for equivalents to the IAR
implementations.

Thanks,
--Royce.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



reply via email to

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