ソースを参照

Safe changes from HAL cleanup

Scott Lahteine 5年前
コミット
1d8ad7cf71

+ 5
- 5
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h ファイルの表示

@@ -160,9 +160,6 @@ uint8_t HAL_get_reset_source(void);
160 160
 
161 161
 void _delay_ms(const int delay);
162 162
 
163
-#pragma GCC diagnostic push
164
-#pragma GCC diagnostic ignored "-Wunused-function"
165
-
166 163
 /*
167 164
 extern "C" {
168 165
   int freeMemory(void);
@@ -172,14 +169,17 @@ extern "C" {
172 169
 extern "C" char* _sbrk(int incr);
173 170
 
174 171
 /*
175
-static int freeMemory() {
172
+int freeMemory() {
176 173
   volatile int top;
177 174
   top = (int)((char*)&top - reinterpret_cast<char*>(_sbrk(0)));
178 175
   return top;
179 176
 }
180 177
 */
181 178
 
182
-static int freeMemory() {
179
+#pragma GCC diagnostic push
180
+#pragma GCC diagnostic ignored "-Wunused-function"
181
+
182
+static inline int freeMemory(void) {
183 183
   volatile char top;
184 184
   return &top - reinterpret_cast<char*>(_sbrk(0));
185 185
 }

+ 6
- 0
Marlin/src/HAL/HAL_STM32_F4_F7/fastio_STM32_F4_F7.h ファイルの表示

@@ -27,6 +27,10 @@
27 27
  * These use GPIO functions instead of Direct Port Manipulation, as on AVR.
28 28
  */
29 29
 
30
+#ifndef PWM
31
+  #define PWM OUTPUT
32
+#endif
33
+
30 34
 #define READ(IO)                digitalRead(IO)
31 35
 #define WRITE(IO,V)             digitalWrite(IO,V)
32 36
 
@@ -61,6 +65,8 @@
61 65
 #define PORTC 2
62 66
 #define PORTD 3
63 67
 #define PORTE 4
68
+#define PORTF 5
69
+#define PORTG 6
64 70
 
65 71
 #define _STM32_PIN(P,PN) ((PORT##P * 16) + PN)
66 72
 

+ 6
- 0
Marlin/src/HAL/shared/Marduino.h ファイルの表示

@@ -31,6 +31,7 @@
31 31
 #undef sq             // Redefined by teensy3/wiring.h
32 32
 #undef SBI            // Redefined by arduino/const_functions.h
33 33
 #undef CBI            // Redefined by arduino/const_functions.h
34
+#undef UNUSED         // Redefined by stm32f4xx_hal_def.h
34 35
 
35 36
 #include <Arduino.h>  // NOTE: If included earlier then this line is a NOOP
36 37
 
@@ -74,3 +75,8 @@
74 75
 #ifndef M_PI
75 76
   #define M_PI 3.14159265358979323846f
76 77
 #endif
78
+
79
+// Remove compiler warning on an unused variable
80
+#ifndef UNUSED
81
+  #define UNUSED(x) ((void)(x))
82
+#endif

+ 0
- 9
Marlin/src/core/macros.h ファイルの表示

@@ -53,15 +53,6 @@
53 53
 // Nanoseconds per cycle
54 54
 #define NANOSECONDS_PER_CYCLE (1000000000.0 / F_CPU)
55 55
 
56
-// Remove compiler warning on an unused variable
57
-#ifndef UNUSED
58
-  #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
59
-    #define UNUSED(X) (void)X
60
-  #else
61
-    #define UNUSED(x) ((void)(x))
62
-  #endif
63
-#endif
64
-
65 56
 // Macros to make a string from a macro
66 57
 #define STRINGIFY_(M) #M
67 58
 #define STRINGIFY(M) STRINGIFY_(M)

+ 7
- 7
Marlin/src/inc/SanityCheck.h ファイルの表示

@@ -390,11 +390,11 @@
390 390
   #error "STRING_SPLASH_LINE[12] are now obsolete. Please remove them from Configuration.h."
391 391
 #endif
392 392
 
393
-#define BOARD_MKS_13        -1109
394
-#define BOARD_TRIGORILLA    -1131
395
-#define BOARD_RURAMPS4D     -3020
396
-#define BOARD_FORMBOT_TREX2 -1125
397
-#define BOARD_BIQU_SKR_V1_1 -2014
393
+#define BOARD_MKS_13        -1000
394
+#define BOARD_TRIGORILLA    -1001
395
+#define BOARD_RURAMPS4D     -1002
396
+#define BOARD_FORMBOT_TREX2 -1003
397
+#define BOARD_BIQU_SKR_V1_1 -1004
398 398
 #if MB(MKS_13)
399 399
   #error "BOARD_MKS_13 has been renamed BOARD_MKS_GEN_13. Please update your configuration."
400 400
 #elif MB(TRIGORILLA)
@@ -403,8 +403,8 @@
403 403
   #error "BOARD_RURAMPS4D has been renamed BOARD_RURAMPS4D_11. Please update your configuration."
404 404
 #elif MB(FORMBOT_TREX2)
405 405
   #error "FORMBOT_TREX2 has been renamed BOARD_FORMBOT_TREX2PLUS. Please update your configuration."
406
-#elif MB(BOARD_BIQU_SKR_V1_1)
407
-  #error "BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration."
406
+#elif MB(BIQU_SKR_V1_1)
407
+  #error "BOARD_BIQU_SKR_V1_1 has been renamed BOARD_BIGTREE_SKR_V1_1. Please update your configuration."
408 408
 #endif
409 409
 #undef BOARD_MKS_13
410 410
 #undef BOARD_TRIGORILLA

+ 8
- 2
Marlin/src/lcd/dogm/HAL_LCD_com_defines.h ファイルの表示

@@ -63,7 +63,10 @@
63 63
     #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_arduino_st7920_hw_spi_fn
64 64
   #endif
65 65
 
66
-  uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
66
+  #ifdef TARGET_LPC1768
67
+    uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
68
+  #endif
69
+
67 70
   #define U8G_COM_SSD_I2C_HAL u8g_com_arduino_ssd_i2c_fn
68 71
 
69 72
   #if PIN_EXISTS(FSMC_CS)
@@ -73,7 +76,8 @@
73 76
     #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
74 77
   #endif
75 78
 
76
-#elif TARGET_LPC1768
79
+#elif defined(TARGET_LPC1768)
80
+
77 81
   uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
78 82
   #define U8G_COM_HAL_SW_SPI_FN u8g_com_HAL_LPC1768_sw_spi_fn
79 83
 
@@ -92,6 +96,7 @@
92 96
   #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
93 97
 
94 98
 #else  // need to give them some definition or else get compiler errors
99
+
95 100
   uint8_t u8g_com_null_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr);
96 101
   #define U8G_COM_HAL_SW_SPI_FN u8g_com_null_fn
97 102
   #define U8G_COM_HAL_HW_SPI_FN u8g_com_null_fn
@@ -99,4 +104,5 @@
99 104
   #define U8G_COM_ST7920_HAL_HW_SPI u8g_com_null_fn
100 105
   #define U8G_COM_SSD_I2C_HAL u8g_com_null_fn
101 106
   #define U8G_COM_HAL_FSMC_FN u8g_com_null_fn
107
+
102 108
 #endif

+ 1
- 1
Marlin/src/pins/ramps/pins_RAMPS.h ファイルの表示

@@ -45,7 +45,7 @@
45 45
  *         7 | 11
46 46
  */
47 47
 
48
-#if ENABLED(TARGET_LPC1768)
48
+#ifdef TARGET_LPC1768
49 49
   #error "Oops! Set MOTHERBOARD to an LPC1768-based board when building for LPC1768."
50 50
 #elif defined(__STM32F1__)
51 51
   #error "Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1."

+ 3
- 1
Marlin/src/pins/stm32/pins_STM32F4.h ファイルの表示

@@ -32,7 +32,9 @@
32 32
 
33 33
 //#define I2C_EEPROM
34 34
 
35
-#define E2END 0xFFF // 4KB
35
+#ifndef E2END
36
+  #define E2END 0xFFF // 4KB
37
+#endif
36 38
 
37 39
 // Ignore temp readings during development.
38 40
 //#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000

読み込み中…
キャンセル
保存