Browse Source

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

[2.0.x][HD44780] Remove unused include
Scott Lahteine 7 years ago
parent
commit
20761b88e0
No account linked to committer's email address

+ 2
- 1
.travis.yml View File

472
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
472
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
473
 
473
 
474
   #############################
474
   #############################
475
-  # STM32F1 default config test
475
+  # STM32F1 config test
476
   #############################
476
   #############################
477
 
477
 
478
   - export TEST_PLATFORM="-e STM32F1"
478
   - export TEST_PLATFORM="-e STM32F1"
479
   - restore_configs
479
   - restore_configs
480
   - opt_set MOTHERBOARD BOARD_STM32F1R
480
   - opt_set MOTHERBOARD BOARD_STM32F1R
481
   - update_defaults
481
   - update_defaults
482
+  - opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
482
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
483
   - build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}

+ 2
- 7
Marlin/src/HAL/HAL_AVR/persistent_store_impl.cpp View File

9
 namespace HAL {
9
 namespace HAL {
10
 namespace PersistentStore {
10
 namespace PersistentStore {
11
 
11
 
12
-bool access_start() {
13
-  return true;
14
-}
15
-
16
-bool access_finish(){
17
-  return true;
18
-}
12
+bool access_start() { return true; }
13
+bool access_finish() { return true; }
19
 
14
 
20
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
15
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
21
   while (size--) {
16
   while (size--) {

+ 5
- 7
Marlin/src/HAL/HAL_DUE/persistent_store_impl.cpp View File

11
 namespace HAL {
11
 namespace HAL {
12
 namespace PersistentStore {
12
 namespace PersistentStore {
13
 
13
 
14
-bool access_start() {
15
-  return true;
16
-}
14
+bool access_start() { return true; }
17
 
15
 
18
-bool access_finish(){
19
-#if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
20
-  eeprom_flush();
21
-#endif
16
+bool access_finish() {
17
+  #if DISABLED(I2C_EEPROM) && DISABLED(SPI_EEPROM)
18
+    eeprom_flush();
19
+  #endif
22
   return true;
20
   return true;
23
 }
21
 }
24
 
22
 

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/persistent_store_flash.cpp View File

54
   return true;
54
   return true;
55
 }
55
 }
56
 
56
 
57
-bool access_finish(){
57
+bool access_finish() {
58
   FLASH_Lock();
58
   FLASH_Lock();
59
   firstWrite = false;
59
   firstWrite = false;
60
   return true;
60
   return true;

+ 12
- 14
Marlin/src/HAL/HAL_STM32F1/persistent_store_impl.cpp View File

44
 namespace HAL {
44
 namespace HAL {
45
 namespace PersistentStore {
45
 namespace PersistentStore {
46
 
46
 
47
-#define CONFIG_FILE_NAME "eeprom.dat"
48
 #define HAL_STM32F1_EEPROM_SIZE 4096
47
 #define HAL_STM32F1_EEPROM_SIZE 4096
49
 char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE];
48
 char HAL_STM32F1_eeprom_content[HAL_STM32F1_EEPROM_SIZE];
50
 
49
 
50
+char eeprom_filename[] = "eeprom.dat";
51
+
51
 bool access_start() {
52
 bool access_start() {
52
   if (!card.cardOK) return false;
53
   if (!card.cardOK) return false;
53
   int16_t bytes_read = 0;
54
   int16_t bytes_read = 0;
54
-  const char eeprom_zero = 0xFF;
55
-  card.openFile((char *)CONFIG_FILE_NAME,true);
56
-  bytes_read = card.read (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
57
-  if (bytes_read == -1) return false;
58
-  for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++) {
55
+  constexpr char eeprom_zero = 0xFF;
56
+  card.openFile(eeprom_filename, true);
57
+  bytes_read = card.read(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
58
+  if (bytes_read < 0) return false;
59
+  for (; bytes_read < HAL_STM32F1_EEPROM_SIZE; bytes_read++)
59
     HAL_STM32F1_eeprom_content[bytes_read] = eeprom_zero;
60
     HAL_STM32F1_eeprom_content[bytes_read] = eeprom_zero;
60
-  }
61
   card.closefile();
61
   card.closefile();
62
   return true;
62
   return true;
63
 }
63
 }
64
 
64
 
65
-bool access_finish(){
65
+bool access_finish() {
66
   if (!card.cardOK) return false;
66
   if (!card.cardOK) return false;
67
-  int16_t bytes_written = 0;
68
-  card.openFile((char *)CONFIG_FILE_NAME,true);
69
-  bytes_written = card.write (HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
67
+  card.openFile(eeprom_filename, true);
68
+  int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE);
70
   card.closefile();
69
   card.closefile();
71
   return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
70
   return (bytes_written == HAL_STM32F1_EEPROM_SIZE);
72
 }
71
 }
73
 
72
 
74
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
73
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
75
-  for (int i = 0; i < size; i++) {
76
-    HAL_STM32F1_eeprom_content [pos + i] = value[i];
77
-  }
74
+  for (int i = 0; i < size; i++)
75
+    HAL_STM32F1_eeprom_content[pos + i] = value[i];
78
   crc16(crc, value, size);
76
   crc16(crc, value, size);
79
   pos += size;
77
   pos += size;
80
   return false;
78
   return false;

+ 0
- 1
Marlin/src/HAL/HAL_STM32F4/persistent_store_impl.cpp View File

33
 namespace PersistentStore {
33
 namespace PersistentStore {
34
 
34
 
35
 bool access_start() { return true; }
35
 bool access_start() { return true; }
36
-
37
 bool access_finish() { return true; }
36
 bool access_finish() { return true; }
38
 
37
 
39
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
38
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {

+ 2
- 7
Marlin/src/HAL/HAL_STM32F7/persistent_store_impl.cpp View File

33
 namespace HAL {
33
 namespace HAL {
34
 namespace PersistentStore {
34
 namespace PersistentStore {
35
 
35
 
36
-bool access_start() {
37
-  return true;
38
-}
39
-
40
-bool access_finish(){
41
-  return true;
42
-}
36
+bool access_start() { return true; }
37
+bool access_finish() { return true; }
43
 
38
 
44
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
39
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
45
   while (size--) {
40
   while (size--) {

+ 2
- 7
Marlin/src/HAL/HAL_TEENSY35_36/persistent_store_impl.cpp View File

9
 namespace HAL {
9
 namespace HAL {
10
 namespace PersistentStore {
10
 namespace PersistentStore {
11
 
11
 
12
-bool access_start() {
13
-  return true;
14
-}
15
-
16
-bool access_finish() {
17
-  return true;
18
-}
12
+bool access_start() { return true; }
13
+bool access_finish() { return true; }
19
 
14
 
20
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
15
 bool write_data(int &pos, const uint8_t *value, uint16_t size, uint16_t *crc) {
21
   while (size--) {
16
   while (size--) {

+ 0
- 4
Marlin/src/lcd/ultralcd_common_HD44780.h View File

52
   #endif
52
   #endif
53
 #endif
53
 #endif
54
 
54
 
55
-#include <binary.h>
56
-
57
 extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
55
 extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
58
 
56
 
59
 ////////////////////////////////////
57
 ////////////////////////////////////
199
 };
197
 };
200
 
198
 
201
 #endif // ULTRALCD_COMMON_HD44780_H
199
 #endif // ULTRALCD_COMMON_HD44780_H
202
-
203
-

+ 5
- 0
Marlin/src/sd/cardreader.h View File

121
   FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
121
   FORCE_INLINE uint8_t percentDone() { return (isFileOpen() && filesize) ? sdpos / ((filesize + 99) / 100) : 0; }
122
   FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
122
   FORCE_INLINE char* getWorkDirName() { workDir.getFilename(filename); return filename; }
123
 
123
 
124
+  #if defined(__STM32F1__) && ENABLED(EEPROM_SETTINGS) && DISABLED(FLASH_EEPROM_EMULATION)
125
+    FORCE_INLINE int16_t read(void* buf, uint16_t nbyte) { return file.isOpen() ? file.read(buf, nbyte) : -1; }
126
+    FORCE_INLINE int16_t write(void* buf, uint16_t nbyte) { return file.isOpen() ? file.write(buf, nbyte) : -1; }
127
+  #endif
128
+
124
   Sd2Card& getSd2Card() { return sd2card; }
129
   Sd2Card& getSd2Card() { return sd2card; }
125
 
130
 
126
   #if ENABLED(AUTO_REPORT_SD_STATUS)
131
   #if ENABLED(AUTO_REPORT_SD_STATUS)

Loading…
Cancel
Save