From f2d93f61c3432e08dab361e9b0ae0f996b507eb4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 Sep 2019 23:51:04 -0500 Subject: [PATCH] Revert errant const --- Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp | 2 +- Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp | 2 +- Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp | 2 +- Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp | 2 +- Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp | 2 +- Marlin/src/HAL/shared/persistent_store_api.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp index 270324b689..fc1baa22ac 100644 --- a/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_DUE/persistent_store_eeprom.cpp @@ -44,7 +44,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; diff --git a/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp b/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp index deefde9155..5227da3568 100644 --- a/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp +++ b/Marlin/src/HAL/HAL_ESP32/persistent_store_spiffs.cpp @@ -72,7 +72,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { if (!eeprom_file.seek(pos)) return true; // return true for any error if (eeprom_file.write(value, size) != size) return true; diff --git a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp index 4f4f371f5e..dac7d7a3a9 100644 --- a/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp +++ b/Marlin/src/HAL/HAL_LPC1768/persistent_store_flash.cpp @@ -109,7 +109,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { for (size_t i = 0; i < size; i++) ram_eeprom[pos + i] = value[i]; eeprom_dirty = true; crc16(crc, value, size); diff --git a/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp index 2a0c991742..e41dd85c85 100644 --- a/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_SAMD51/persistent_store_eeprom.cpp @@ -58,7 +58,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { #if NONE(SPI_EEPROM, I2C_EEPROM) if (NVMCTRL->SEESTAT.bit.RLOCK) NVMCTRL_CMD(NVMCTRL_CTRLB_CMD_USEE); // Unlock E2P data write access diff --git a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp index ff8313dd83..c94bce3b65 100644 --- a/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_STM32/persistent_store_impl.cpp @@ -50,7 +50,7 @@ bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t v = *value; diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp index a7fe530c6a..babcdeaee3 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp @@ -40,7 +40,7 @@ bool PersistentStore::access_start() { } bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; diff --git a/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp index 0b119730b6..4bd86d225d 100644 --- a/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_STM32_F4_F7/persistent_store_eeprom.cpp @@ -32,7 +32,7 @@ bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; diff --git a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp index 0c95277438..6da102638f 100644 --- a/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp +++ b/Marlin/src/HAL/HAL_TEENSY31_32/persistent_store_impl.cpp @@ -27,7 +27,7 @@ bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; diff --git a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp index 2f063a4d4a..17934f71a3 100644 --- a/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp +++ b/Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_eeprom.cpp @@ -33,7 +33,7 @@ bool PersistentStore::access_start() { return true; } bool PersistentStore::access_finish() { return true; } -bool PersistentStore::write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc) { +bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) { while (size--) { uint8_t * const p = (uint8_t * const)pos; uint8_t v = *value; diff --git a/Marlin/src/HAL/shared/persistent_store_api.h b/Marlin/src/HAL/shared/persistent_store_api.h index 0f4834b9b3..02013120a7 100644 --- a/Marlin/src/HAL/shared/persistent_store_api.h +++ b/Marlin/src/HAL/shared/persistent_store_api.h @@ -31,7 +31,7 @@ class PersistentStore { public: static bool access_start(); static bool access_finish(); - static bool write_data(int &pos, const uint8_t *value, const size_t size, uint16_t *crc); + 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 size_t capacity();