Irena NOVAKOVIC wrote:
> it is a test of the printf function and it doesn't compile (it says :
>
> thermotest.c:73: error 98: conflict with previous definition of 
> 'putchar' for attribute 'wparam'
> thermotest.c:73: error 52: Actual Argument type different from 
> declaration 1
> from type 'unsigned-char'
> to type 'char')
>  
> i defined putchar and getchar(communications on the serial port of 
> PIC) before main and in main i put printf("test");. The code of 
> putchar and getchar works when i put it directly in main without 
> calling the printf function. So the problem might be the wrong 
> declaration of those functions (or in the wrong place). 
In device/include/pic16/stdio.h you will find a macro declarations like 
this:

#define PUTCHAR(arg)    void putchar(unsigned char arg) __wparam

This is the proper way to define a "putchar" function, just write:

PUTCHAR(my_putchar)
{
    blah...
    blah...
}

There is nothing similar for getchar, but definition for getchar is

char getchar(void);

no dark keywords here!:-)


hope this solves your problem...

Vangelis Rokas


-------------------------------------------------------------------------
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

Reply via email to