瀏覽代碼

Hide freeMemory et.al. warnings

Scott Lahteine 6 年之前
父節點
當前提交
4200f9ed62
共有 2 個文件被更改,包括 12 次插入6 次删除
  1. 10
    4
      Marlin/src/HAL/HAL_STM32F1/HAL.h
  2. 2
    2
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

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

159
 #define __bss_end __bss_end__
159
 #define __bss_end __bss_end__
160
 
160
 
161
 /** clear reset reason */
161
 /** clear reset reason */
162
-void HAL_clear_reset_source (void);
162
+void HAL_clear_reset_source(void);
163
 
163
 
164
 /** reset reason */
164
 /** reset reason */
165
-uint8_t HAL_get_reset_source (void);
165
+uint8_t HAL_get_reset_source(void);
166
 
166
 
167
 void _delay_ms(const int delay);
167
 void _delay_ms(const int delay);
168
 
168
 
180
   return top;
180
   return top;
181
 }
181
 }
182
 */
182
 */
183
+
184
+#pragma GCC diagnostic push
185
+#pragma GCC diagnostic ignored "-Wunused-function"
186
+
183
 static int freeMemory() {
187
 static int freeMemory() {
184
   volatile char top;
188
   volatile char top;
185
   return &top - reinterpret_cast<char*>(_sbrk(0));
189
   return &top - reinterpret_cast<char*>(_sbrk(0));
186
 }
190
 }
187
 
191
 
192
+#pragma GCC diagnostic pop
193
+
188
 //
194
 //
189
 // SPI: Extended functions which take a channel number (hardware SPI only)
195
 // SPI: Extended functions which take a channel number (hardware SPI only)
190
 //
196
 //
206
  */
212
  */
207
 void eeprom_write_byte(uint8_t *pos, unsigned char value);
213
 void eeprom_write_byte(uint8_t *pos, unsigned char value);
208
 uint8_t eeprom_read_byte(uint8_t *pos);
214
 uint8_t eeprom_read_byte(uint8_t *pos);
209
-void eeprom_read_block (void *__dst, const void *__src, size_t __n);
210
-void eeprom_update_block (const void *__src, void *__dst, size_t __n);
215
+void eeprom_read_block(void *__dst, const void *__src, size_t __n);
216
+void eeprom_update_block(const void *__src, void *__dst, size_t __n);
211
 
217
 
212
 //
218
 //
213
 // ADC
219
 // ADC

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp 查看文件

62
 }
62
 }
63
 
63
 
64
 bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
64
 bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) {
65
-  for (int i = 0; i < size; i++)
65
+  for (size_t i = 0; i < size; i++)
66
     HAL_STM32F1_eeprom_content[pos + i] = value[i];
66
     HAL_STM32F1_eeprom_content[pos + i] = value[i];
67
   crc16(crc, value, size);
67
   crc16(crc, value, size);
68
   pos += size;
68
   pos += size;
70
 }
70
 }
71
 
71
 
72
 bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
72
 bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uint16_t *crc, const bool writing/*=true*/) {
73
-  for (int i = 0; i < size; i++) {
73
+  for (size_t i = 0; i < size; i++) {
74
     uint8_t c = HAL_STM32F1_eeprom_content[pos + i];
74
     uint8_t c = HAL_STM32F1_eeprom_content[pos + i];
75
     if (writing) value[i] = c;
75
     if (writing) value[i] = c;
76
     crc16(crc, &c, 1);
76
     crc16(crc, &c, 1);

Loading…
取消
儲存