Kaynağa Gözat

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

Karl Andersson 6 yıl önce
ebeveyn
işleme
8ae6f1e556

+ 1
- 7
Marlin/src/HAL/HAL_STM32/HAL.h Dosyayı Görüntüle

@@ -24,10 +24,6 @@
24 24
 
25 25
 #define CPU_32_BIT
26 26
 
27
-#ifndef vsnprintf_P
28
-  #define vsnprintf_P vsnprintf
29
-#endif
30
-
31 27
 // --------------------------------------------------------------------------
32 28
 // Includes
33 29
 // --------------------------------------------------------------------------
@@ -105,8 +101,6 @@
105 101
   #define NUM_SERIAL 1
106 102
 #endif
107 103
 
108
-#define _BV(b) (1 << (b))
109
-
110 104
 /**
111 105
  * TODO: review this to return 1 for pins that are not analog input
112 106
  */
@@ -177,7 +171,7 @@ void _delay_ms(const int delay);
177 171
 
178 172
 extern "C" char* _sbrk(int incr);
179 173
 
180
-static int freeMemory() {
174
+static inline int freeMemory() {
181 175
   volatile char top;
182 176
   return &top - reinterpret_cast<char*>(_sbrk(0));
183 177
 }

+ 0
- 1
Marlin/src/HAL/HAL_STM32/fastio_STM32.h Dosyayı Görüntüle

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

+ 3
- 1
Marlin/src/core/macros.h Dosyayı Görüntüle

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

+ 3
- 0
Marlin/src/pins/pins_ARMED.h Dosyayı Görüntüle

@@ -29,10 +29,13 @@
29 29
 #endif
30 30
 
31 31
 #define DEFAULT_MACHINE_NAME "Arm'ed"
32
+
33
+#undef BOARD_NAME
32 34
 #define BOARD_NAME "Arm'ed"
33 35
 
34 36
 #define I2C_EEPROM
35 37
 
38
+#undef E2END
36 39
 #define E2END 0xFFF // EEPROM end address (4kB)
37 40
 
38 41
 #if HOTENDS > 2 || E_STEPPERS > 2

+ 7
- 7
platformio.ini Dosyayı Görüntüle

@@ -284,13 +284,13 @@ monitor_speed = 250000
284 284
 # ARMED
285 285
 #
286 286
 [env:ARMED]
287
-platform      = ststm32
288
-framework     = arduino
289
-board         = ARMED
290
-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
291
-lib_deps      = ${common.lib_deps}
292
-lib_ignore    = Adafruit NeoPixel, c1921b4
293
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F4>
287
+platform    = ststm32
288
+framework   = arduino
289
+board       = armed_v1
290
+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
291
+lib_deps    = ${common.lib_deps}
292
+lib_ignore  = Adafruit NeoPixel, c1921b4
293
+src_filter  = ${common.default_src_filter} +<src/HAL/HAL_STM32>
294 294
 monitor_speed = 250000
295 295
 
296 296
 #

Loading…
İptal
Kaydet