Altera_Forum
Honored Contributor
19 years agoHELP!!
This is my program:
# include <stdio.h># include <sys/types.h># include <fcntl.h> int main() { int p_button=NULL; unsigned int x=0; p_button=open("/dev/ttyS0",O_RDWR); if(p_button<0) { printf("\nopen uart device ERROE!\n"); return 0; } for(x=200;x<256;x++) { write(p_button,&x,1); printf("write rs232 end!\n"); read(p_button,&x,1); printf("read rs232 end!\n"); if(x==0) {close(p_button);return 0;} } close(p_button); } These are the problems: Severity Description Resource In Folder Location Creation Time 1 initialization makes integer from pointer without a cast test.c hello line 7 May 23, 2006 9:56:29 AM 1 implicit declaration of function `write' test.c hello line 17 May 23, 2006 9:56:29 AM 1 implicit declaration of function `read' test.c hello line 19 May 23, 2006 9:56:29 AM 1 implicit declaration of function `close' test.c hello line 21 May 23, 2006 9:56:29 AM They are warning ! But,it always die in "read",Why?? another problem :when I download program(*.exe) in the target though FTP, the problem can't run. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/blink.gif Thanks!!