abduld / picoc

Automatically exported from code.google.com/p/picoc
3 stars 0 forks source link

implement something to point a memory mapped device #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to use picoC on an embedded board (mc68000) without any OS

so if picoC is part of the "firmware" then it should be nice to directly
point a "memory mapped device"

if the "memory-mapped device" is located at 0x8000, you can access it using
 something like the following

#define device_addr 0x8000
#define pdevice_bytetype volatile unsigned char
pdevice_bytetype xdata *pdevice_byte = (char xdata *) device_addr;

u-mmm may be it could be simplified without any CASTING

pdevice_bytetype xdata *pdevice_byte = device_addr;

device_addr is a "native pointer" that access directly the address pointed!

could you implement this feature ?

Original issue reported on code.google.com by flameman...@gmail.com on 14 Sep 2009 at 8:41

GoogleCodeExporter commented 9 years ago
Have a look at the NATIVE_POINTERS option. It's an experimental feature which 
may do
exactly what you want.

Original comment by zik.sale...@gmail.com on 4 Oct 2009 at 3:20

GoogleCodeExporter commented 9 years ago
the problem is how to tell picoC to setup a pointer: it needs something to 
interpret this

pdevice_bytetype xdata *pdevice_byte = (char xdata *) device_addr;

how to do do ? 

Original comment by flameman...@gmail.com on 6 Oct 2009 at 3:23

GoogleCodeExporter commented 9 years ago
Another user has reported a bug in native pointers. See bug #54.

Original comment by zik.sale...@gmail.com on 6 Oct 2009 at 7:55

GoogleCodeExporter commented 9 years ago
See bug #54 is similar to the bug i pointed out
picoC is bugged about
1) char byte addressing
2) endianess (issues with bigendian machines)

ok, but what i am asking here is: could you implement something to handle 
pointer
assignment ? could you show how ?

i'd like to invoke picoC and see it pretty able to understand

pdevice_bytetype xdata *pdevice_byte = (char xdata *) device_addr;

Original comment by flameman...@gmail.com on 6 Oct 2009 at 8:17