Compare commits
3 Commits
29fed8328c
...
94b59918fc
Author | SHA1 | Date | |
---|---|---|---|
94b59918fc | |||
d095e26c9e | |||
09507b5734 |
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,41 +1,64 @@
|
||||
#include <stm-periph/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;
|
||||
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;
|
||||
}
|
||||
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)
|
||||
{
|
||||
(void)fd;
|
||||
|
||||
heap_end += incr;
|
||||
return (char*) prev_heap_end;
|
||||
}
|
||||
int _isatty(int 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) {
|
||||
uart_send_array((char*)buf, count);
|
||||
|
||||
int _write(int fd, const void *buf, int count)
|
||||
{
|
||||
if (fd == 1)
|
||||
uart_send_array((char*)buf, count);
|
||||
return count;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user