Browse Source

Remove 'const' from PersistentStore::capacity

pull/1/head
Scott Lahteine 6 years ago
parent
commit
834ea7fcea
  1. 2
      Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp
  2. 2
      Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp
  3. 12
      Marlin/src/HAL/HAL_LPC1768/HAL.cpp
  4. 2
      Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp
  5. 2
      Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp
  6. 2
      Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp
  7. 2
      Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp
  8. 2
      Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp
  9. 2
      Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp
  10. 2
      Marlin/src/HAL/shared/persistent_store_api.h

2
Marlin/src/HAL/HAL_AVR/persistent_store_eeprom.cpp

@ -62,7 +62,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false; // always assume success for AVR's
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS
#endif // __AVR__

2
Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp

@ -71,7 +71,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS
#endif // ARDUINO_ARCH_SAM

12
Marlin/src/HAL/HAL_LPC1768/HAL.cpp

@ -125,13 +125,13 @@ bool HAL_adc_finished(void) {
// possible config options if something similar is extended to more platforms.
#define ADC_USE_MEDIAN_FILTER // Filter out erroneous readings
#define ADC_MEDIAN_FILTER_SIZE (23) // Higher values increase step delay (phase shift),
#define ADC_MEDIAN_FILTER_SIZE 23 // Higher values increase step delay (phase shift),
// (ADC_MEDIAN_FILTER_SIZE + 1) / 2 sample step delay (12 samples @ 500Hz: 24ms phase shift)
// Memory usage per ADC channel (bytes): (6 * ADC_MEDIAN_FILTER_SIZE) + 16
// 8 * ((6 * 23) + 16 ) = 1232 Bytes for 8 channels
#define ADC_USE_LOWPASS_FILTER // Filter out high frequency noise
#define ADC_LOWPASS_K_VALUE (6) // Higher values increase rise time
#define ADC_LOWPASS_K_VALUE 6 // Higher values increase rise time
// Rise time sample delays for 100% signal convergence on full range step
// (1 : 13, 2 : 32, 3 : 67, 4 : 139, 5 : 281, 6 : 565, 7 : 1135, 8 : 2273)
// K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
@ -162,7 +162,7 @@ struct MedianFilter {
datum = STOPPER + 1; // No stoppers allowed.
}
if ( (++datpoint - buffer) >= ADC_MEDIAN_FILTER_SIZE) {
if ( (++datpoint - buffer) >= (ADC_MEDIAN_FILTER_SIZE)) {
datpoint = buffer; // Increment and wrap data in pointer.
}
@ -224,9 +224,9 @@ struct MedianFilter {
struct LowpassFilter {
uint32_t data_delay = 0;
uint16_t update(uint16_t value) {
data_delay = data_delay - (data_delay >> ADC_LOWPASS_K_VALUE) + value;
return (uint16_t)(data_delay >> ADC_LOWPASS_K_VALUE);
uint16_t update(const uint16_t value) {
data_delay -= (data_delay >> (ADC_LOWPASS_K_VALUE)) - value;
return (uint16_t)(data_delay >> (ADC_LOWPASS_K_VALUE));
}
};

2
Marlin/src/HAL/HAL_LPC1768/persistent_store_sdcard.cpp

@ -175,7 +175,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return bytes_read != size; // return true for any error
}
const size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
size_t PersistentStore::capacity() { return 4096; } // 4KiB of Emulated EEPROM
#endif // !FLASH_EEPROM
#endif // EEPROM_SETTINGS

2
Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp

@ -101,7 +101,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return false;
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS && EEPROM FLASH
#endif // __STM32F1__

2
Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp

@ -79,7 +79,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, const size_t size, uin
return false;
}
const size_t PersistentStore::capacity() { return HAL_STM32F1_EEPROM_SIZE; }
size_t PersistentStore::capacity() { return HAL_STM32F1_EEPROM_SIZE; }
#endif // EEPROM_SETTINGS

2
Marlin/src/HAL/HAL_STM32F4/persistent_store_eeprom.cpp

@ -64,7 +64,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS
#endif // STM32F4 || STM32F4xx

2
Marlin/src/HAL/HAL_STM32F7/persistent_store_eeprom.cpp

@ -64,7 +64,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS
#endif // STM32F7

2
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp

@ -65,7 +65,7 @@ bool PersistentStore::read_data(int &pos, uint8_t* value, size_t size, uint16_t
return false;
}
const size_t PersistentStore::capacity() { return E2END + 1; }
size_t PersistentStore::capacity() { return E2END + 1; }
#endif // EEPROM_SETTINGS
#endif // __MK64FX512__ || __MK66FX1M0__

2
Marlin/src/HAL/shared/persistent_store_api.h

@ -31,7 +31,7 @@ public:
static bool access_finish();
static bool write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc);
static bool read_data(int &pos, uint8_t* value, size_t size, uint16_t *crc, const bool writing=true);
static const size_t capacity();
static size_t capacity();
static inline bool write_data(const int pos, uint8_t* value, const size_t size) {
int data_pos = pos;

Loading…
Cancel
Save