From: Joerg Wunsch <j...@uriah.heep.sax.de>
To: avr-gcc-list@nongnu.org 
Sent: Tuesday, September 18, 2012 11:21 AM

>What's the point?  A pointer is just a 32-bit (or perhaps 24-bit,
>in recent AVR-GCC versions) number.

>Normally, the point of using a pointer is that the compiler arranges
>for you to dereference the pointer automatically, but this memory
>being external, not accessible by normal CPU instructions, this cannot
>work anyway.  Consequently, you can use the respective integer numbers
>by itself (perhaps through some kind of typedef that hints them being
>memory addresses).

Thanks for the response. Basically the requirement is to use external serial 
FLASH memory. We wanted large pointer for two things
1. To declare a section and assign variable names which is better than using 
absolute addresses. This is possible.
2. Pass the address to functions which do the reading and writing the memory. 
Given below is an example function prototype we would like to have

void ReadXFlashBlock (unsigned char *destptr, unsigned char *sourceaddr, 
unsigned int noofbytes);

In the above destptr is not an issue but sourceaddr is. If a 32 bit pointer can 
be somehow declared then this will be pretty elegant. If this is not possible 
then the only alternative would be to change the function parameters as shown 
below which is not really elegant.

void ReadXFlashBlock (unsigned char *destptr, long sourceaddr, unsigned int 
noofbytes);
The calling program must treat this long variable as a pointer rather than long 
itself.

Nayani
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to