Fix errors and some compiler warnings with HAL_STM32 PlatformIO build (#12869)

This commit is contained in:
Karl Andersson 2019-01-11 02:01:31 +01:00 committed by Scott Lahteine
parent e6484d9dab
commit 8ae6f1e556
5 changed files with 14 additions and 16 deletions

View file

@ -24,10 +24,6 @@
#define CPU_32_BIT
#ifndef vsnprintf_P
#define vsnprintf_P vsnprintf
#endif
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
@ -105,8 +101,6 @@
#define NUM_SERIAL 1
#endif
#define _BV(b) (1 << (b))
/**
* TODO: review this to return 1 for pins that are not analog input
*/
@ -177,7 +171,7 @@ void _delay_ms(const int delay);
extern "C" char* _sbrk(int incr);
static int freeMemory() {
static inline int freeMemory() {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
}

View file

@ -43,7 +43,6 @@ void FastIO_init(); // Must be called before using fast io macros
// Defines
// --------------------------------------------------------------------------
#define _BV(b) (1 << (b))
#define _BV32(b) (1UL << (b))
#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)

View file

@ -56,7 +56,9 @@
#define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
// Remove compiler warning on an unused variable
#define UNUSED(x) ((void)(x))
#if !defined(ARDUINO_ARCH_STM32) || defined(STM32GENERIC)
#define UNUSED(x) ((void)(x))
#endif
// Macros to make a string from a macro
#define STRINGIFY_(M) #M

View file

@ -29,10 +29,13 @@
#endif
#define DEFAULT_MACHINE_NAME "Arm'ed"
#undef BOARD_NAME
#define BOARD_NAME "Arm'ed"
#define I2C_EEPROM
#undef E2END
#define E2END 0xFFF // EEPROM end address (4kB)
#if HOTENDS > 2 || E_STEPPERS > 2

View file

@ -284,13 +284,13 @@ monitor_speed = 250000
# ARMED
#
[env:ARMED]
platform = ststm32
framework = arduino
board = ARMED
build_flags = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11
lib_deps = ${common.lib_deps}
lib_ignore = Adafruit NeoPixel, c1921b4
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32F4>
platform = ststm32
framework = arduino
board = armed_v1
build_flags = ${common.build_flags} -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11
lib_deps = ${common.lib_deps}
lib_ignore = Adafruit NeoPixel, c1921b4
src_filter = ${common.default_src_filter} +<src/HAL/HAL_STM32>
monitor_speed = 250000
#