@@ -26,7 +26,7 @@ void changeIgnore()
26
26
SerLCD.print (F (" N" ));
27
27
}
28
28
// Record this new setting
29
- EEPROM.write (LOCATION_IGNORE_RX, settingIgnoreRX);
29
+ EEPROM.update (LOCATION_IGNORE_RX, settingIgnoreRX);
30
30
31
31
petSafeDelay (SYSTEM_MESSAGE_DELAY);
32
32
@@ -53,7 +53,7 @@ void displayFirmwareVersion()
53
53
// Press a or z to adjust, x to exit
54
54
void changeContrast (byte contrast)
55
55
{
56
- EEPROM.write (LOCATION_CONTRAST, contrast); // Store this new contrast
56
+ EEPROM.update (LOCATION_CONTRAST, contrast); // Store this new contrast
57
57
58
58
// Go to this new contrast
59
59
analogWrite (LCD_CONTRAST, contrast);
@@ -74,7 +74,7 @@ void changeContrast(byte contrast)
74
74
void changeTWIAddress (byte newAddress)
75
75
{
76
76
// Record the new address
77
- EEPROM.write (LOCATION_TWI_ADDRESS, newAddress);
77
+ EEPROM.update (LOCATION_TWI_ADDRESS, newAddress);
78
78
79
79
setupTWI (); // Leverage the regular startup function
80
80
@@ -95,7 +95,7 @@ void changeSplashContent()
95
95
{
96
96
// Record the current frame to EEPROM
97
97
for (byte x = 0 ; x < settingLCDlines * settingLCDwidth ; x++)
98
- EEPROM.write (LOCATION_SPLASH_CONTENT + x, currentFrame[x]);
98
+ EEPROM.update (LOCATION_SPLASH_CONTENT + x, currentFrame[x]);
99
99
100
100
// Display the backlight setting
101
101
SerLCD.clear ();
@@ -114,17 +114,17 @@ void changeBLBrightness(byte color, byte brightness)
114
114
{
115
115
if (color == RED)
116
116
{
117
- EEPROM.write (LOCATION_RED_BRIGHTNESS, brightness); // Record new setting
117
+ EEPROM.update (LOCATION_RED_BRIGHTNESS, brightness); // Record new setting
118
118
analogWrite (BL_RW, 255 - brightness); // Controlled by PNP so reverse the brightness value
119
119
}
120
120
else if (color == GREEN)
121
121
{
122
- EEPROM.write (LOCATION_GREEN_BRIGHTNESS, brightness); // Record new setting
122
+ EEPROM.update (LOCATION_GREEN_BRIGHTNESS, brightness); // Record new setting
123
123
analogWrite (BL_G, 255 - brightness); // Controlled by PNP so reverse the brightness value
124
124
}
125
125
else if (color == BLUE)
126
126
{
127
- EEPROM.write (LOCATION_BLUE_BRIGHTNESS, brightness); // Record new setting
127
+ EEPROM.update (LOCATION_BLUE_BRIGHTNESS, brightness); // Record new setting
128
128
// analogWrite(BL_B, 255 - brightness); //Controlled by PNP so reverse the brightness value
129
129
SoftPWMSet (BL_B, 255 - brightness); // Controlled by software PWM
130
130
}
@@ -154,15 +154,15 @@ void changeBLBrightness(byte color, byte brightness)
154
154
// with their rgb values to eliminate flicker. Incoming brightness values should be 0 to 255
155
155
void changeBacklightRGB (byte red, byte green, byte blue) {
156
156
// update red
157
- EEPROM.write (LOCATION_RED_BRIGHTNESS, red); // Record new setting
157
+ EEPROM.update (LOCATION_RED_BRIGHTNESS, red); // Record new setting
158
158
analogWrite (BL_RW, 255 - red); // Controlled by PNP so reverse the brightness value
159
159
160
160
// update green
161
- EEPROM.write (LOCATION_GREEN_BRIGHTNESS, green); // Record new setting
161
+ EEPROM.update (LOCATION_GREEN_BRIGHTNESS, green); // Record new setting
162
162
analogWrite (BL_G, 255 - green); // Controlled by PNP so reverse the brightness value
163
163
164
164
// update blue (SoftPWM)
165
- EEPROM.write (LOCATION_BLUE_BRIGHTNESS, blue); // Record new setting
165
+ EEPROM.update (LOCATION_BLUE_BRIGHTNESS, blue); // Record new setting
166
166
// analogWrite(BL_B, 255 - brightness); //Controlled by PNP so reverse the brightness value
167
167
SoftPWMSet (BL_B, 255 - blue); // Controlled by software PWM
168
168
}
@@ -216,7 +216,7 @@ void changeUARTSpeed(byte setting)
216
216
}
217
217
218
218
// Record this new buad rate
219
- EEPROM.write (LOCATION_BAUD, settingUARTSpeed);
219
+ EEPROM.update (LOCATION_BAUD, settingUARTSpeed);
220
220
221
221
// Display that we are at this new speed
222
222
SerLCD.clear ();
@@ -254,7 +254,7 @@ void changeSplashEnable()
254
254
petSafeDelay (SYSTEM_MESSAGE_DELAY);
255
255
256
256
// Record this new setting
257
- EEPROM.write (LOCATION_SPLASH_ONOFF, settingSplashEnable);
257
+ EEPROM.update (LOCATION_SPLASH_ONOFF, settingSplashEnable);
258
258
259
259
displayFrameBuffer (); // Return the contents of the display
260
260
}
@@ -287,8 +287,8 @@ void changeLinesWidths(byte setting)
287
287
clearFrameBuffer ();
288
288
289
289
// Record this new setting
290
- EEPROM.write (LOCATION_WIDTH, settingLCDwidth);
291
- EEPROM.write (LOCATION_LINES, settingLCDlines);
290
+ EEPROM.update (LOCATION_WIDTH, settingLCDwidth);
291
+ EEPROM.update (LOCATION_LINES, settingLCDlines);
292
292
293
293
// Display new settings to the user
294
294
SerLCD.clear ();
0 commit comments