瀏覽代碼

Reduce unused function warnings

Scott Lahteine 5 年之前
父節點
當前提交
fb579212ea

+ 3
- 0
Marlin/src/HAL/HAL_AVR/HAL.h 查看文件

@@ -114,9 +114,12 @@ void HAL_init(void);
114 114
 inline void HAL_clear_reset_source(void) { MCUSR = 0; }
115 115
 inline uint8_t HAL_get_reset_source(void) { return MCUSR; }
116 116
 
117
+#pragma GCC diagnostic push
118
+#pragma GCC diagnostic ignored "-Wunused-function"
117 119
 extern "C" {
118 120
   int freeMemory(void);
119 121
 }
122
+#pragma GCC diagnostic pop
120 123
 
121 124
 // timers
122 125
 #define HAL_TIMER_RATE          ((F_CPU) / 8)    // i.e., 2MHz or 2.5MHz

+ 5
- 1
Marlin/src/HAL/HAL_DUE/HAL.h 查看文件

@@ -156,12 +156,16 @@ void HAL_init(void);
156 156
 // Utility functions
157 157
 //
158 158
 void _delay_ms(const int delay);
159
+
160
+#pragma GCC diagnostic push
161
+#pragma GCC diagnostic ignored "-Wunused-function"
159 162
 int freeMemory(void);
163
+#pragma GCC diagnostic pop
160 164
 
161 165
 #ifdef __cplusplus
162 166
   extern "C" {
163 167
 #endif
164
-char *dtostrf (double __val, signed char __width, unsigned char __prec, char *__s);
168
+char *dtostrf(double __val, signed char __width, unsigned char __prec, char *__s);
165 169
 #ifdef __cplusplus
166 170
   }
167 171
 #endif

+ 3
- 0
Marlin/src/HAL/HAL_ESP32/HAL.h 查看文件

@@ -92,7 +92,10 @@ uint8_t HAL_get_reset_source(void);
92 92
 
93 93
 void _delay_ms(int delay);
94 94
 
95
+#pragma GCC diagnostic push
96
+#pragma GCC diagnostic ignored "-Wunused-function"
95 97
 int freeMemory(void);
98
+#pragma GCC diagnostic pop
96 99
 
97 100
 void analogWrite(pin_t pin, int value);
98 101
 

+ 3
- 0
Marlin/src/HAL/HAL_LINUX/HAL.h 查看文件

@@ -81,7 +81,10 @@ extern HalSerial usb_serial;
81 81
 inline void HAL_init(void) { }
82 82
 
83 83
 // Utility functions
84
+#pragma GCC diagnostic push
85
+#pragma GCC diagnostic ignored "-Wunused-function"
84 86
 int freeMemory(void);
87
+#pragma GCC diagnostic pop
85 88
 
86 89
 // SPI: Extended functions which take a channel number (hardware SPI only)
87 90
 /** Write single byte to specified SPI channel */

+ 3
- 0
Marlin/src/HAL/HAL_LPC1768/HAL.h 查看文件

@@ -111,7 +111,10 @@ extern "C" volatile uint32_t _millis;
111 111
 //
112 112
 // Utility functions
113 113
 //
114
+#pragma GCC diagnostic push
115
+#pragma GCC diagnostic ignored "-Wunused-function"
114 116
 int freeMemory(void);
117
+#pragma GCC diagnostic pop
115 118
 
116 119
 //
117 120
 // SPI: Extended functions taking a channel number (Hardware SPI only)

+ 8
- 2
Marlin/src/HAL/HAL_SAMD51/HAL.h 查看文件

@@ -132,11 +132,17 @@ void noTone(const pin_t _pin);
132 132
 
133 133
 // Enable hooks into idle and setup for HAL
134 134
 void HAL_init(void);
135
-/*#define HAL_IDLETASK 1
136
-void HAL_idletask(void);*/
135
+/*
136
+#define HAL_IDLETASK 1
137
+void HAL_idletask(void);
138
+*/
137 139
 
138 140
 //
139 141
 // Utility functions
140 142
 //
141 143
 FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
144
+
145
+#pragma GCC diagnostic push
146
+#pragma GCC diagnostic ignored "-Wunused-function"
142 147
 int freeMemory(void);
148
+#pragma GCC diagnostic pop

+ 13
- 8
Marlin/src/HAL/HAL_STM32/HAL.h 查看文件

@@ -136,7 +136,7 @@ typedef int16_t pin_t;
136 136
 // Public Variables
137 137
 // ------------------------
138 138
 
139
-/** result of last ADC conversion */
139
+// result of last ADC conversion
140 140
 extern uint16_t HAL_adc_result;
141 141
 
142 142
 // ------------------------
@@ -149,30 +149,35 @@ extern uint16_t HAL_adc_result;
149 149
 // Enable hooks into  setup for HAL
150 150
 void HAL_init(void);
151 151
 
152
-/** clear reset reason */
152
+// Clear reset reason
153 153
 void HAL_clear_reset_source (void);
154 154
 
155
-/** reset reason */
155
+// Reset reason
156 156
 uint8_t HAL_get_reset_source(void);
157 157
 
158 158
 void _delay_ms(const int delay);
159 159
 
160 160
 extern "C" char* _sbrk(int incr);
161 161
 
162
+#pragma GCC diagnostic push
163
+#pragma GCC diagnostic ignored "-Wunused-function"
164
+
162 165
 static inline int freeMemory() {
163 166
   volatile char top;
164 167
   return &top - reinterpret_cast<char*>(_sbrk(0));
165 168
 }
166 169
 
170
+#pragma GCC diagnostic pop
171
+
167 172
 //
168 173
 // SPI: Extended functions which take a channel number (hardware SPI only)
169 174
 //
170 175
 
171
-/** Write single byte to specified SPI channel */
176
+// Write single byte to specified SPI channel
172 177
 void spiSend(uint32_t chan, byte b);
173
-/** Write buffer to specified SPI channel */
178
+// Write buffer to specified SPI channel
174 179
 void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
175
-/** Read single byte from specified SPI channel */
180
+// Read single byte from specified SPI channel
176 181
 uint8_t spiRec(uint32_t chan);
177 182
 
178 183
 //
@@ -182,8 +187,8 @@ uint8_t spiRec(uint32_t chan);
182 187
 // Wire library should work for i2c EEPROMs
183 188
 void eeprom_write_byte(uint8_t *pos, unsigned char value);
184 189
 uint8_t eeprom_read_byte(uint8_t *pos);
185
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
186
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
190
+void eeprom_read_block(void *__dst, const void *__src, size_t __n);
191
+void eeprom_update_block(const void *__src, void *__dst, size_t __n);
187 192
 
188 193
 //
189 194
 // ADC

+ 10
- 9
Marlin/src/HAL/HAL_STM32F1/HAL.h 查看文件

@@ -158,7 +158,7 @@ typedef int8_t pin_t;
158 158
 // Public Variables
159 159
 // ------------------------
160 160
 
161
-/** result of last ADC conversion */
161
+// Result of last ADC conversion
162 162
 extern uint16_t HAL_adc_result;
163 163
 
164 164
 // ------------------------
@@ -174,14 +174,17 @@ extern uint16_t HAL_adc_result;
174 174
 // Memory related
175 175
 #define __bss_end __bss_end__
176 176
 
177
-/** clear reset reason */
177
+// Clear reset reason
178 178
 void HAL_clear_reset_source(void);
179 179
 
180
-/** reset reason */
180
+// Reset reason
181 181
 uint8_t HAL_get_reset_source(void);
182 182
 
183 183
 void _delay_ms(const int delay);
184 184
 
185
+#pragma GCC diagnostic push
186
+#pragma GCC diagnostic ignored "-Wunused-function"
187
+
185 188
 /*
186 189
 extern "C" {
187 190
   int freeMemory(void);
@@ -189,6 +192,7 @@ extern "C" {
189 192
 */
190 193
 
191 194
 extern "C" char* _sbrk(int incr);
195
+
192 196
 /*
193 197
 static int freeMemory() {
194 198
   volatile int top;
@@ -197,9 +201,6 @@ static int freeMemory() {
197 201
 }
198 202
 */
199 203
 
200
-#pragma GCC diagnostic push
201
-#pragma GCC diagnostic ignored "-Wunused-function"
202
-
203 204
 static int freeMemory() {
204 205
   volatile char top;
205 206
   return &top - reinterpret_cast<char*>(_sbrk(0));
@@ -211,11 +212,11 @@ static int freeMemory() {
211 212
 // SPI: Extended functions which take a channel number (hardware SPI only)
212 213
 //
213 214
 
214
-/** Write single byte to specified SPI channel */
215
+// Write single byte to specified SPI channel
215 216
 void spiSend(uint32_t chan, byte b);
216
-/** Write buffer to specified SPI channel */
217
+// Write buffer to specified SPI channel
217 218
 void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
218
-/** Read single byte from specified SPI channel */
219
+// Read single byte from specified SPI channel
219 220
 uint8_t spiRec(uint32_t chan);
220 221
 
221 222
 //

+ 12
- 9
Marlin/src/HAL/HAL_STM32_F4_F7/HAL.h 查看文件

@@ -37,7 +37,7 @@
37 37
 
38 38
 #include <stdint.h>
39 39
 
40
-#ifdef defined(STM32F4) && USBCON
40
+#if defined(STM32F4) && USBCON
41 41
   #include <USBSerial.h>
42 42
 #endif
43 43
 
@@ -100,8 +100,6 @@
100 100
   #define NUM_SERIAL 1
101 101
 #endif
102 102
 
103
-#define _BV(b) (1 << (b))
104
-
105 103
 /**
106 104
  * TODO: review this to return 1 for pins that are not analog input
107 105
  */
@@ -142,7 +140,7 @@ typedef int8_t pin_t;
142 140
 // Public Variables
143 141
 // ------------------------
144 142
 
145
-/** result of last ADC conversion */
143
+// Result of last ADC conversion
146 144
 extern uint16_t HAL_adc_result;
147 145
 
148 146
 // ------------------------
@@ -154,14 +152,17 @@ extern uint16_t HAL_adc_result;
154 152
 
155 153
 inline void HAL_init(void) { }
156 154
 
157
-/** clear reset reason */
155
+// Clear reset reason
158 156
 void HAL_clear_reset_source (void);
159 157
 
160
-/** reset reason */
158
+// Reset reason
161 159
 uint8_t HAL_get_reset_source(void);
162 160
 
163 161
 void _delay_ms(const int delay);
164 162
 
163
+#pragma GCC diagnostic push
164
+#pragma GCC diagnostic ignored "-Wunused-function"
165
+
165 166
 /*
166 167
 extern "C" {
167 168
   int freeMemory(void);
@@ -183,15 +184,17 @@ static int freeMemory() {
183 184
   return &top - reinterpret_cast<char*>(_sbrk(0));
184 185
 }
185 186
 
187
+#pragma GCC diagnostic pop
188
+
186 189
 //
187 190
 // SPI: Extended functions which take a channel number (hardware SPI only)
188 191
 //
189 192
 
190
-/** Write single byte to specified SPI channel */
193
+// Write single byte to specified SPI channel
191 194
 void spiSend(uint32_t chan, byte b);
192
-/** Write buffer to specified SPI channel */
195
+// Write buffer to specified SPI channel
193 196
 void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
194
-/** Read single byte from specified SPI channel */
197
+// Read single byte from specified SPI channel
195 198
 uint8_t spiRec(uint32_t chan);
196 199
 
197 200
 //

+ 3
- 0
Marlin/src/HAL/HAL_TEENSY31_32/HAL.h 查看文件

@@ -97,9 +97,12 @@ uint8_t HAL_get_reset_source(void);
97 97
 
98 98
 FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
99 99
 
100
+#pragma GCC diagnostic push
101
+#pragma GCC diagnostic ignored "-Wunused-function"
100 102
 extern "C" {
101 103
   int freeMemory(void);
102 104
 }
105
+#pragma GCC diagnostic pop
103 106
 
104 107
 // SPI: Extended functions which take a channel number (hardware SPI only)
105 108
 

+ 8
- 5
Marlin/src/HAL/HAL_TEENSY35_36/HAL.h 查看文件

@@ -95,24 +95,27 @@ typedef int8_t pin_t;
95 95
 
96 96
 inline void HAL_init(void) { }
97 97
 
98
-/** clear reset reason */
98
+// Clear reset reason
99 99
 void HAL_clear_reset_source(void);
100 100
 
101
-/** reset reason */
101
+// Reset reason
102 102
 uint8_t HAL_get_reset_source(void);
103 103
 
104 104
 FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }
105 105
 
106
+#pragma GCC diagnostic push
107
+#pragma GCC diagnostic ignored "-Wunused-function"
106 108
 extern "C" {
107 109
   int freeMemory(void);
108 110
 }
111
+#pragma GCC diagnostic pop
109 112
 
110 113
 // SPI: Extended functions which take a channel number (hardware SPI only)
111
-/** Write single byte to specified SPI channel */
114
+// Write single byte to specified SPI channel
112 115
 void spiSend(uint32_t chan, byte b);
113
-/** Write buffer to specified SPI channel */
116
+// Write buffer to specified SPI channel
114 117
 void spiSend(uint32_t chan, const uint8_t* buf, size_t n);
115
-/** Read single byte from specified SPI channel */
118
+// Read single byte from specified SPI channel
116 119
 uint8_t spiRec(uint32_t chan);
117 120
 
118 121
 // ADC

Loading…
取消
儲存