Keil Logo Arm Logo

Discussion Forum

problem redefining putchar

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Nirav Mehta
Posted
14-Dec-2004 17:28 GMT
Toolset
C51
New! problem redefining putchar
#include <reg51.h>
#include <stdio.h>

........
lcd code
........

char putchar(char c) {

lcd_rs = 1; //data
lcd_rw = 0; //write

lcd_en = 1;
lcd_data = c;
lcd_en = 0;

if (!lcd_busy_check())
error_blink();
else
return (c);
}

I get an error :
Compiling...
..\8051_TRIAL_1\MAIN.C
..\8051_TRIAL_1\MAIN.C(92): Error: Type redefined: putch
..\8051_TRIAL_1\MAIN.C(92): Warning: Parameter declaration different: parameter 1
Complete

I checked the header stdio.h, it has putchar defined as :

#define putchar(c) putch(c)
...
int putch(int);

What can i do?
Read-Only
Author
Ingvar Kreft
Posted
15-Dec-2004 08:35 GMT
Toolset
C51
New! RE: problem redefining putchar
Hi
You can for start change
char putchar(char c)

to whats defined in stdio.h

int putch(int);

/Ingvar

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.