[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Porting code to/from codevision
From: |
David Kelly |
Subject: |
Re: [avr-gcc-list] Porting code to/from codevision |
Date: |
Wed, 23 Nov 2005 20:49:35 -0600 |
On Nov 23, 2005, at 6:15 PM, Peter Harrison wrote:
Specifically, I have a largeish lookup table (4k) and menu data
(titles, function pointers etc) to deal with. I have considered
using a macro for the data access so that I can write
value = READ_FLASH_BYTE(addr);
and define the macro as null in CVAVR or as required by AVRGCC.
However, I am less sure about the declarations and can't get my
head round a suitable dodge.
Just to make things more awkward, I may well want this code to
compile with the ARM and H8 GCC compilers. On the PC, I simply have
a macro that defines 'flash' as null and the code compiles just fine.
Is this overdoing the portability thing?
No, thats what macros and include files are all about.
In general avr-gcc uses macros to modify data access to FLASH, and to
modify for declaring data stays in FLASH and should not be copied to
RAM during startup. Essentially all you have to do is create NULL
versions for Codevision or insert whatever special things Codevision
likes.
--
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.