diff --git a/Marlin/src/HAL/HAL_STM32/HAL.h b/Marlin/src/HAL/HAL_STM32/HAL.h index 9542d8c404..d71bc756e3 100644 --- a/Marlin/src/HAL/HAL_STM32/HAL.h +++ b/Marlin/src/HAL/HAL_STM32/HAL.h @@ -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(_sbrk(0)); } diff --git a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h b/Marlin/src/HAL/HAL_STM32/fastio_STM32.h index be45dab925..3de6d51e24 100644 --- a/Marlin/src/HAL/HAL_STM32/fastio_STM32.h +++ b/Marlin/src/HAL/HAL_STM32/fastio_STM32.h @@ -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) diff --git a/Marlin/src/core/macros.h b/Marlin/src/core/macros.h index 1c57d88c86..bfdbdd5529 100644 --- a/Marlin/src/core/macros.h +++ b/Marlin/src/core/macros.h @@ -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 diff --git a/Marlin/src/pins/pins_ARMED.h b/Marlin/src/pins/pins_ARMED.h index fd6ffe6e0e..ade43895bb 100644 --- a/Marlin/src/pins/pins_ARMED.h +++ b/Marlin/src/pins/pins_ARMED.h @@ -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 diff --git a/platformio.ini b/platformio.ini index 8947e3f640..f1340effd0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -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} + +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} + monitor_speed = 250000 #