First test version to sample temperature input and blink LEDs

This commit is contained in:
2020-01-26 21:07:54 +01:00
parent 284f2b26c4
commit ad7badba56
21 changed files with 472 additions and 47 deletions

48
stm-firmware/syscalls.c Normal file
View File

@@ -0,0 +1,48 @@
/*
* syscalls.c
*
* Created on: Dec 14, 2014
* Author: shino-chan
*/
#include "uart.h"
char* _sbrk(int incr) {
extern char heap_low; // Defined by the linker
extern char heap_top;
static char *heap_end;
char *prev_heap_end;
if (heap_end == 0) {
heap_end = &heap_low;
}
prev_heap_end = heap_end;
if (heap_end + incr > &heap_top) {
return 0;
}
heap_end += incr;
return (char*) prev_heap_end;
}
int _isatty(int fd) {
return 1;
}
int _close(int fd) {
return 0;
}
int _open(int fd) {
return 0;
}
int _fstat(void) {
return 0;
}
int _lseek(void) {
return 0;
}
int _read(void) {
return 0;
}
int _write(int fd, const void *buf, int count) {
sendString((char*)buf, count);
return count;
}