Compare commits

...

3 Commits

4 changed files with 50 additions and 25 deletions

View File

@ -54,7 +54,7 @@ LFLAGS += -Tstm32f407vet6_flash.ld -Wl,-Map=$(mapfile).map
CFLAGS = -c -fmessage-length=0 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles -O0 -g
CFLAGS += -Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter
####################################################################################
OBJ = $(CFILES:%.c=$(OBJDIR)/%.c.o)

View File

@ -399,7 +399,7 @@ static void SetSysClock(void)
RCC->CFGR |= RCC_CFGR_SW_PLL;
/* Wait till the main PLL is used as system clock source */
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL);
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL)
{
}
}

View File

@ -121,6 +121,7 @@ static shellmatta_retCode_t shell_cmd_clear_error_status(const shellmatta_handle
{
(void)arguments;
(void)length;
(void)handle;
adc_pt1000_clear_error();
@ -133,6 +134,7 @@ static shellmatta_retCode_t shell_cmd_uptime(const shellmatta_handle_t handle,
{
(void)arguments;
(void)length;
shellmatta_printf(handle, "Uptime: %llu secs", global_tick_ms/1000);
return SHELLMATTA_OK;
}

View File

@ -1,6 +1,7 @@
#include <stm-periph/uart.h>
char* _sbrk(int incr) {
char* _sbrk(int incr)
{
extern char heap_low; // Defined by the linker
extern char heap_top;
static char *heap_end;
@ -9,6 +10,7 @@ char* _sbrk(int incr) {
if (heap_end == 0) {
heap_end = &heap_low;
}
prev_heap_end = heap_end;
if (heap_end + incr > &heap_top) {
return 0;
@ -16,26 +18,47 @@ char* _sbrk(int incr) {
heap_end += incr;
return (char*) prev_heap_end;
}
int _isatty(int fd) {
}
int _isatty(int fd)
{
(void)fd;
return 1;
}
int _close(int fd) {
int _close(int fd)
{
(void)fd;
return 0;
}
int _open(int fd) {
int _open(int fd)
{
(void)fd;
return 0;
}
int _fstat(void) {
int _fstat(void)
{
return 0;
}
int _lseek(void) {
int _lseek(void)
{
return 0;
}
int _read(void) {
int _read(void)
{
return 0;
}
int _write(int fd, const void *buf, int count) {
int _write(int fd, const void *buf, int count)
{
if (fd == 1)
uart_send_array((char*)buf, count);
return count;
}