Oh God... sorry again... pls do not consider the function "change_value" in the version I just sent. Its just another test I was trying just when I got your reply.

Anyway, you should have enough info so that someone can reproduce the problem...

On 1/14/07, Rodrigo Guerra <tioguerra@gmail.com> wrote:
Hello Borut,

Thanks for the reply but pls see my second message. I misspelled the last line in the email but it is correct in the program (I do use *p = 0x12).

I attached the full source for your reference this time. I use two LEDs to debug my program in the device. I have one green LED in RA4 and another orange LED in RB4. The green LED goes on with PORTA = 0x00 and goes off when PORTA = 0x10. The same for the orange LED with PORTB.

With the attached source the green goes on. When I uncomment the *p = 0x12 line both LEDs remain off. I tested several times and I am sure both LEDs are working ok and several other conditional tests worked fine. The dereferenced read also seems to work okay ( gptrget1.c).

PS.: This is a test application I wrote in order to narrow the problem I had with the original program (which is much longer).

I am still stuck with this.
I feel like I will try to re-design my code so that I don't need to use pointer dereferenced writing of values.

Let me know if you find something else strange with this...

Cheers,
Guerra


On 1/14/07, Borut Razem < borut.razem@siol.net> wrote:
Rodrigo Guerra wrote:
> <snip>
> void main(void)
> {
>      unsigned char c = 0x34;
>      unsigned char *p;
>
>      p = &c;
>      p = 0x12;
>
> (...)
> <snip>
It should be:
*p = 0x12;

Borut


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user



--

Rodrigo da Silva Guerra
PhD Student

Department of Adaptive Machine Systems
Graduate School of Engineering
Osaka University - Japan




--
Rodrigo da Silva Guerra
PhD Student

Department of Adaptive Machine Systems
Graduate School of Engineering
Osaka University - Japan