Bläddra i källkod

Strip never-used eeprom functions

Scott Lahteine 5 år sedan
förälder
incheckning
a521b0edbb

+ 0
- 2
Marlin/src/HAL/shared/eeprom_if.h Visa fil

@@ -26,5 +26,3 @@
26 26
 //
27 27
 void eeprom_write_byte(uint8_t *pos, unsigned char value);
28 28
 uint8_t eeprom_read_byte(uint8_t *pos);
29
-void eeprom_read_block(void *__dst, const void *__src, size_t __n);
30
-void eeprom_update_block(const void *__src, void *__dst, size_t __n);

+ 0
- 46
Marlin/src/HAL/shared/eeprom_if_i2c.cpp Visa fil

@@ -68,37 +68,6 @@ void eeprom_write_byte(uint8_t *pos, unsigned char value) {
68 68
   delay(EEPROM_WRITE_DELAY);
69 69
 }
70 70
 
71
-// WARNING: address is a page address, 6-bit end will wrap around
72
-// also, data can be maximum of about 30 bytes, because the Wire library has a buffer of 32 bytes
73
-void eeprom_update_block(const void *pos, void *__dst, size_t n) {
74
-  const unsigned eeprom_address = (unsigned)__dst;
75
-
76
-  eeprom_init();
77
-
78
-  Wire.beginTransmission(eeprom_device_address);
79
-  Wire.write(int(eeprom_address >> 8));   // MSB
80
-  Wire.write(int(eeprom_address & 0xFF)); // LSB
81
-  Wire.endTransmission();
82
-
83
-  uint8_t *ptr = (uint8_t*)pos;
84
-  uint8_t flag = 0;
85
-  Wire.requestFrom(eeprom_device_address, (byte)n);
86
-  for (byte c = 0; c < n && Wire.available(); c++)
87
-    flag |= Wire.read() ^ ptr[c];
88
-
89
-  if (flag) {
90
-    Wire.beginTransmission(eeprom_device_address);
91
-    Wire.write(int(eeprom_address >> 8));   // MSB
92
-    Wire.write(int(eeprom_address & 0xFF)); // LSB
93
-    Wire.write((uint8_t*)pos, n);
94
-    Wire.endTransmission();
95
-
96
-    // wait for write cycle to complete
97
-    // this could be done more efficiently with "acknowledge polling"
98
-    delay(EEPROM_WRITE_DELAY);
99
-  }
100
-}
101
-
102 71
 uint8_t eeprom_read_byte(uint8_t *pos) {
103 72
   const unsigned eeprom_address = (unsigned)pos;
104 73
 
@@ -110,19 +79,4 @@ uint8_t eeprom_read_byte(uint8_t *pos) {
110 79
   return Wire.available() ? Wire.read() : 0xFF;
111 80
 }
112 81
 
113
-// Don't read more than 30..32 bytes at a time!
114
-void eeprom_read_block(void* pos, const void *__dst, size_t n) {
115
-  const unsigned eeprom_address = (unsigned)__dst;
116
-
117
-  eeprom_init();
118
-
119
-  Wire.beginTransmission(eeprom_device_address);
120
-  Wire.write(int(eeprom_address >> 8));   // MSB
121
-  Wire.write(int(eeprom_address & 0xFF)); // LSB
122
-  Wire.endTransmission();
123
-  Wire.requestFrom(eeprom_device_address, (byte)n);
124
-  for (byte c = 0; c < n; c++ )
125
-    if (Wire.available()) *((uint8_t*)pos + c) = Wire.read();
126
-}
127
-
128 82
 #endif // USE_SHARED_EEPROM && I2C_EEPROM

+ 0
- 40
Marlin/src/HAL/shared/eeprom_if_spi.cpp Visa fil

@@ -58,24 +58,6 @@ uint8_t eeprom_read_byte(uint8_t* pos) {
58 58
   return v;
59 59
 }
60 60
 
61
-void eeprom_read_block(void* dest, const void* eeprom_address, size_t n) {
62
-  uint8_t eeprom_temp[3];
63
-
64
-  // set read location
65
-  // begin transmission from device
66
-  eeprom_temp[0] = CMD_READ;
67
-  eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF; // addr High
68
-  eeprom_temp[2] = (unsigned)eeprom_address& 0xFF;       // addr Low
69
-  WRITE(SPI_EEPROM1_CS, HIGH);
70
-  WRITE(SPI_EEPROM1_CS, LOW);
71
-  spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
72
-
73
-  uint8_t *p_dest = (uint8_t *)dest;
74
-  while (n--)
75
-    *p_dest++ = spiRec(SPI_CHAN_EEPROM1);
76
-  WRITE(SPI_EEPROM1_CS, HIGH);
77
-}
78
-
79 61
 void eeprom_write_byte(uint8_t* pos, uint8_t value) {
80 62
   uint8_t eeprom_temp[3];
81 63
 
@@ -98,26 +80,4 @@ void eeprom_write_byte(uint8_t* pos, uint8_t value) {
98 80
   delay(EEPROM_WRITE_DELAY);   // wait for page write to complete
99 81
 }
100 82
 
101
-void eeprom_update_block(const void* src, void* eeprom_address, size_t n) {
102
-  uint8_t eeprom_temp[3];
103
-
104
-  /*write enable*/
105
-  eeprom_temp[0] = CMD_WREN;
106
-  WRITE(SPI_EEPROM1_CS, LOW);
107
-  spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 1);
108
-  WRITE(SPI_EEPROM1_CS, HIGH);
109
-  delay(1);
110
-
111
-  /*write addr*/
112
-  eeprom_temp[0] = CMD_WRITE;
113
-  eeprom_temp[1] = ((unsigned)eeprom_address>>8) & 0xFF;  //addr High
114
-  eeprom_temp[2] = (unsigned)eeprom_address & 0xFF;       //addr Low
115
-  WRITE(SPI_EEPROM1_CS, LOW);
116
-  spiSend(SPI_CHAN_EEPROM1, eeprom_temp, 3);
117
-
118
-  spiSend(SPI_CHAN_EEPROM1, (const uint8_t*)src, n);
119
-  WRITE(SPI_EEPROM1_CS, HIGH);
120
-  delay(EEPROM_WRITE_DELAY);   // wait for page write to complete
121
-}
122
-
123 83
 #endif // USE_SHARED_EEPROM && I2C_EEPROM

Laddar…
Avbryt
Spara