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, [EMAIL PROTECTED]
========================================================================
Whom computers would destroy, they must first drive mad.



_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to