Просмотр исходного кода

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

Karl Andersson 6 лет назад
Родитель
Сommit
8ae6f1e556

+ 1
- 7
Marlin/src/HAL/HAL_STM32/HAL.h Просмотреть файл

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

+ 0
- 1
Marlin/src/HAL/HAL_STM32/fastio_STM32.h Просмотреть файл

43
 // Defines
43
 // Defines
44
 // --------------------------------------------------------------------------
44
 // --------------------------------------------------------------------------
45
 
45
 
46
-#define _BV(b) (1 << (b))
47
 #define _BV32(b) (1UL << (b))
46
 #define _BV32(b) (1UL << (b))
48
 
47
 
49
 #if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)
48
 #if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || defined(STM32L0xx) || defined(STM32L4xx)

+ 3
- 1
Marlin/src/core/macros.h Просмотреть файл

56
 #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
56
 #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
57
 
57
 
58
 // Remove compiler warning on an unused variable
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
 // Macros to make a string from a macro
63
 // Macros to make a string from a macro
62
 #define STRINGIFY_(M) #M
64
 #define STRINGIFY_(M) #M

+ 3
- 0
Marlin/src/pins/pins_ARMED.h Просмотреть файл

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

+ 7
- 7
platformio.ini Просмотреть файл

284
 # ARMED
284
 # ARMED
285
 #
285
 #
286
 [env:ARMED]
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
 monitor_speed = 250000
294
 monitor_speed = 250000
295
 
295
 
296
 #
296
 #

Загрузка…
Отмена
Сохранить