Merge pull request #11212 from AlexanderAmelkin/2.0-HD44780-remove-unused-include

[2.0.x][HD44780] Remove unused include
This commit is contained in:
Scott Lahteine 2018-07-08 17:19:59 -05:00 committed by GitHub
commit 20761b88e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 49 deletions

View File

@ -472,11 +472,12 @@ script:
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
############################# #############################
# STM32F1 default config test # STM32F1 config test
############################# #############################
- export TEST_PLATFORM="-e STM32F1" - export TEST_PLATFORM="-e STM32F1"
- restore_configs - restore_configs
- opt_set MOTHERBOARD BOARD_STM32F1R - opt_set MOTHERBOARD BOARD_STM32F1R
- update_defaults - update_defaults
- opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
- build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM} - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}

View File

@ -9,13 +9,8 @@
namespace HAL { namespace HAL {
namespace PersistentStore { namespace PersistentStore {
bool access_start() { bool access_start() { return true; }
return true; bool access_finish() { return true; }
}
bool access_finish(){
return true;
}
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
while (size--) { while (size--) {

View File

@ -11,14 +11,12 @@ extern void eeprom_flush(void);
namespace HAL { namespace HAL {
namespace PersistentStore { namespace PersistentStore {
bool access_start() { bool access_start() { return true; }
return true;
}
bool access_finish(){ bool access_finish() {
#if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM) #if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
eeprom_flush(); eeprom_flush();
#endif #endif
return true; return true;
} }

View File

@ -54,7 +54,7 @@ bool access_start() {
return true; return true;
} }
bool access_finish(){ bool access_finish() {
FLASH_Lock(); FLASH_Lock();
firstWrite = false; firstWrite = false;
return true; return true;

View File

@ -44,37 +44,35 @@
namespace HAL { namespace HAL {
namespace PersistentStore { namespace PersistentStore {
#define CONFIG_FILE_NAME "eeprom.dat"
#define HAL_STM32F1_EEPROM_SIZE 4096 #define HAL_STM32F1_EEPROM_SIZE 4096
char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE]; char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE];
char eeprom_filename[] = "eeprom.dat";
bool access_start() { bool access_start() {
if (!card.cardOK) return false; if (!card.cardOK) return false;
int16_t bytes_read = 0; int16_t bytes_read = 0;
const char eeprom_zero = 0xFF; constexpr char eeprom_zero = 0xFF;
card.openFile((char *)CONFIG_FILE_NAME,true); card.openFile(eeprom_filename, true);
bytes_read = card.read (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); bytes_read = card.read(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
if (bytes_read == -1) return false; if (bytes_read < 0) return false;
for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++) { for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++)
HAL_STM32F1_eeprom_content[bytes_read] = eeprom_zero; HAL_STM32F1_eeprom_content[bytes_read] = eeprom_zero;
}
card.closefile(); card.closefile();
return true; return true;
} }
bool access_finish(){ bool access_finish() {
if (!card.cardOK) return false; if (!card.cardOK) return false;
int16_t bytes_written = 0; card.openFile(eeprom_filename, true);
card.openFile((char *)CONFIG_FILE_NAME,true); int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
bytes_written = card.write (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
card.closefile(); card.closefile();
return (bytes_written == HAL_STM32F1_EEPROM_SIZE); return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
} }
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++)
HAL_STM32F1_eeprom_content [pos + i] = value[i]; HAL_STM32F1_eeprom_content[pos + i] = value[i];
}
crc16(crc, value, size); crc16(crc, value, size);
pos += size; pos += size;
return false; return false;

View File

@ -33,7 +33,6 @@ namespace HAL {
namespace PersistentStore { namespace PersistentStore {
bool access_start() { return true; } bool access_start() { return true; }
bool access_finish() { return true; } bool access_finish() { return true; }
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {

View File

@ -33,13 +33,8 @@
namespace HAL { namespace HAL {
namespace PersistentStore { namespace PersistentStore {
bool access_start() { bool access_start() { return true; }
return true; bool access_finish() { return true; }
}
bool access_finish(){
return true;
}
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
while (size--) { while (size--) {

View File

@ -9,13 +9,8 @@
namespace HAL { namespace HAL {
namespace PersistentStore { namespace PersistentStore {
bool access_start() { bool access_start() { return true; }
return true; bool access_finish() { return true; }
}
bool access_finish() {
return true;
}
bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) { bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
while (size--) { while (size--) {

View File

@ -52,8 +52,6 @@
#endif #endif
#endif #endif
#include <binary.h>
extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array. extern volatile uint8_t buttons; //an extended version of the last checked buttons in a bit array.
//////////////////////////////////// ////////////////////////////////////
@ -199,5 +197,3 @@ enum HD44780CharSet : char {
}; };
#endif // ULTRALCD_COMMON_HD44780_H #endif // ULTRALCD_COMMON_HD44780_H

View File

@ -121,6 +121,11 @@ public:
FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; } FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; } FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
#if defined(__STM32F1__) && ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
#endif
Sd2Card& getSd2Card() { return sd2card; } Sd2Card& getSd2Card() { return sd2card; }
#if ENABLED(AUTO_REPORT_SD_STATUS) #if ENABLED(AUTO_REPORT_SD_STATUS)