20 #include <sys/types.h> 22 #include <sys/fcntl.h> 27 #include <sys/times.h> 36 #define MAX_STACK_SIZE 0x2000 42 register char * stack_ptr
asm(
"sp");
48 caddr_t _sbrk(
int incr)
50 extern char end
asm(
"end");
51 static char *heap_end;
52 char *prev_heap_end,*min_stack_ptr;
57 prev_heap_end = heap_end;
61 min_stack_ptr = (
char*)(*(
unsigned int *)*(
unsigned int *)0xE000ED08);
65 if (heap_end + incr > min_stack_ptr)
67 if (heap_end + incr > stack_ptr)
78 return (caddr_t) prev_heap_end;
89 tzp->tz_minuteswest = 0;
119 HAL_UART_Transmit(&
UsartHandle,(uint8_t *)ptr,len,10000);
130 st->st_mode = S_IFCHR;
144 int _read(
int file,
char *ptr,
int len)
148 for (DataIdx = 0; DataIdx < len; DataIdx++)
156 int _open(
char *path,
int flags, ...)
179 int _stat(
char *file,
struct stat *st)
181 st->st_mode = S_IFCHR;
197 int _execve(
char *name,
char **argv,
char **env)
int _read(int file, char *ptr, int len)
int _open(char *path, int flags,...)
int __io_putchar(int ch) __attribute__((weak))
int _link(char *old, char *new)
int _gettimeofday(struct timeval *tp, struct timezone *tzp)
void initialise_monitor_handles()
int _stat(char *file, struct stat *st)
int _times(struct tms *buf)
USART Initialization to stream printf() output back to the ST-LINK.
int _kill(int pid, int sig)
int _fstat(int file, struct stat *st)
int _execve(char *name, char **argv, char **env)
UART_HandleTypeDef UsartHandle
int _lseek(int file, int ptr, int dir)
int _write(int file, char *ptr, int len)