소스 검색

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,10 +159,10 @@ extern uint16_t HAL_adc_result;
159 159
 #define __bss_end __bss_end__
160 160
 
161 161
 /** clear reset reason */
162
-void HAL_clear_reset_source (void);
162
+void HAL_clear_reset_source(void);
163 163
 
164 164
 /** reset reason */
165
-uint8_t HAL_get_reset_source (void);
165
+uint8_t HAL_get_reset_source(void);
166 166
 
167 167
 void _delay_ms(const int delay);
168 168
 
@@ -180,11 +180,17 @@ static int freeMemory() {
180 180
   return top;
181 181
 }
182 182
 */
183
+
184
+#pragma GCC diagnostic push
185
+#pragma GCC diagnostic ignored "-Wunused-function"
186
+
183 187
 static int freeMemory() {
184 188
   volatile char top;
185 189
   return &top - reinterpret_cast<char*>(_sbrk(0));
186 190
 }
187 191
 
192
+#pragma GCC diagnostic pop
193
+
188 194
 //
189 195
 // SPI: Extended functions which take a channel number (hardware SPI only)
190 196
 //
@@ -206,8 +212,8 @@ uint8_t spiRec(uint32_t chan);
206 212
  */
207 213
 void eeprom_write_byte(uint8_t *pos, unsigned char value);
208 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 219
 // ADC

+ 2
- 2
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp 파일 보기

@@ -62,7 +62,7 @@ bool PersistentStore::access_finish() {
62 62
 }
63 63
 
64 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 66
     HAL_STM32F1_eeprom_content[pos + i] = value[i];
67 67
   crc16(crc, value, size);
68 68
   pos += size;
@@ -70,7 +70,7 @@ bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t si
70 70
 }
71 71
 
72 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 74
     uint8_t c = HAL_STM32F1_eeprom_content[pos + i];
75 75
     if (writing) value[i] = c;
76 76
     crc16(crc, &c, 1);

Loading…
취소
저장