#define BUFSIZ 512\r
#define CC_BUFFER_SIZE ((BUFSIZ)+32)\r
volatile unsigned int _CIOBUF_[CC_BUFFER_SIZE] __attribute__ ((section (".cio")));\r
+static unsigned char CIOTMPBUF[BUFSIZ];\r
+static uint16 cio_tmp_buf_index = 0;\r
\r
/***************************************************************************/\r
/* */\r
{\r
int result;\r
\r
+ // WARNING. Can only handle count == 1!\r
+ if (count != 1) _exit(1);\r
+\r
if (count > BUFSIZ) count = BUFSIZ;\r
\r
+ if (cio_tmp_buf_index < BUFSIZ) {\r
+ CIOTMPBUF[cio_tmp_buf_index++] = *buf;\r
+\r
+ if (*buf != 0xA) { // Only flush if newline\r
+ return 0;\r
+ }\r
+ }\r
+\r
+\r
LOADSHORT(parmbuf,dev_fd,0);\r
- LOADSHORT(parmbuf,count,2);\r
- writemsg(_DTWRITE,parmbuf,(char *)buf,count);\r
+ LOADSHORT(parmbuf,cio_tmp_buf_index,2);\r
+ writemsg(_DTWRITE,parmbuf,(char *)CIOTMPBUF,cio_tmp_buf_index);\r
readmsg(parmbuf,NULL);\r
\r
result = UNLOADSHORT(parmbuf,0);\r
\r
+ cio_tmp_buf_index = 0;\r
+\r
return result;\r
}\r
\r