HAL_ChibiOS: fixed build without FATFS enabled

This commit is contained in:
Andrew Tridgell 2018-02-03 09:02:01 +11:00
parent 6b187b393a
commit 29add8a880
4 changed files with 9 additions and 2 deletions

View File

@ -51,6 +51,7 @@ endif
ifeq ($(USE_FATFS),)
USE_FATFS = yes
FATFS_FLAGS=-DUSE_FATFS
endif
#
@ -102,9 +103,9 @@ include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Other files (optional).
#include $(CHIBIOS)/test/rt/test.mk
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk
ifeq ($(USE_FATFS),yes)
include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
endif
@ -218,7 +219,7 @@ CPPWARN = -Wall -Wextra -Wundef
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
UDEFS = $(FATFS_FLAGS)
# Define ASM defines here
UADEFS =

View File

@ -52,6 +52,8 @@ void *malloc_ccm(size_t size)
if (p != NULL) {
memset(p, 0, size);
}
#else
(void)size;
#endif
return p;
}

View File

@ -227,6 +227,7 @@ atob(uint32_t *vp, char *p, int base)
}
#if HAL_OS_FATFS_IO
/*
* vsscanf(buf,fmt,ap)
*/
@ -343,3 +344,4 @@ static int vfscanf (FILE *stream, const char *fmt, va_list ap)
count = vsscanf (buf, fmt, ap);
return (count);
}
#endif // HAL_OS_FATFS_IO

View File

@ -27,7 +27,9 @@ int vasprintf(char **strp, const char *fmt, va_list ap);
int asprintf(char **strp, const char *fmt, ...);
int vprintf(const char *fmt, va_list arg);
int printf(const char *fmt, ...);
#if defined(USE_FATFS) || (defined(HAL_OS_FATFS_IO) && HAL_OS_FATFS_IO)
int fscanf ( FILE * stream, const char * format, ... );
#endif
int scanf (const char *fmt, ...);
int sscanf (const char *buf, const char *fmt, ...);