Skip to content

Commit

Permalink
Fix errors and some compiler warnings with HAL_STM32 PlatformIO build (
Browse files Browse the repository at this point in the history
  • Loading branch information
ktand authored and thinkyhead committed Jan 11, 2019
1 parent e6484d9 commit 8ae6f1e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
8 changes: 1 addition & 7 deletions Marlin/src/HAL/HAL_STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

#define CPU_32_BIT

#ifndef vsnprintf_P
#define vsnprintf_P vsnprintf
#endif

// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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));
}
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/HAL_STM32/fastio_STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/pins/pins_ARMED.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down

0 comments on commit 8ae6f1e

Please sign in to comment.