30 #if !defined(__CROSSWORKS_ARM) && defined(__GNUC__)
43 int _fstat(
int file,
struct stat *st);
45 int _lseek(
int file,
int ptr,
int dir);
46 int _read(
int file,
char *ptr,
int len);
47 caddr_t
_sbrk(
int incr);
48 int _write(
int file,
const char *ptr,
int len);
92 int _fstat(
int file,
struct stat *st)
95 st->st_mode = S_IFCHR;
175 int _read(
int file,
char *ptr,
int len)
214 static char *heap_end;
216 static const char heaperr[] =
"Heap and stack collision\n";
223 prev_heap_end = heap_end;
224 if ((heap_end + incr) > (
char*) __get_MSP())
226 _write(fileno(stdout), heaperr, strlen(heaperr));
231 return (caddr_t) prev_heap_end;
250 int _write(
int file,
const char *ptr,
int len)
256 for (txCount = 0; txCount < len; txCount++)
265 #if defined(__ICCARM__)
301 static int TxBuf(uint8_t *buffer,
int nbytes)
305 for (i = 0; i < nbytes; i++)
318 size_t __write(
int handle,
const unsigned char * buffer,
size_t size)
336 if (handle != _LLIO_STDOUT && handle != _LLIO_STDERR)
342 if (TxBuf((uint8_t *) buffer, size) != size)
350 size_t __read(
int handle,
unsigned char * buffer,
size_t size)
357 if (handle != _LLIO_STDIN)
362 for (; size > 0; --size)
379 #if defined(__CROSSWORKS_ARM)
382 int __putchar(
int ch)
394 #if defined(__CC_ARM)
430 int fputc(
int ch, FILE *f)
474 void _ttywrch(
int ch)
487 void _sys_exit(
int return_code)
int RETARGET_ReadChar(void)
Receive a byte from USART/LEUART and put into global buffer.
int _lseek(int file, int ptr, int dir)
Set position in a file.
int _read(int file, char *ptr, int len)
Read from a file.
caddr_t _sbrk(int incr)
Increase heap.
int _isatty(int file)
Query whether output stream is a terminal.
int _kill(int pid, int sig)
Send signal to process.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
int _getpid(void)
Get process ID.
int _write(int file, const char *ptr, int len)
Write to a file.
int RETARGET_WriteChar(char c)
Transmit single byte to USART/LEUART.
static volatile int rxCount
void _exit(int status)
Exit the program.
int _fstat(int file, struct stat *st)
Status of an open file.
int _close(int file)
Close a file.