Skip to content

Commit 1c38a72

Browse files
committed
Rename function to persistSettings
1 parent de57a80 commit 1c38a72

File tree

9 files changed

+26
-24
lines changed

9 files changed

+26
-24
lines changed

examples/ChangeI2CAddress/ChangeI2CAddress.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void setup() {
3939
checkConnection(device);
4040

4141
// Store the new address in flash
42-
device.storeSettingsInFlash();
42+
device.persistSettings();
4343

4444
Serial.println("🔄 Resetting device to check if change is persistent...");
4545
device.reset();

examples/UARTRead/UARTRead.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* NiclaSenseEnv device;
1414
* device.begin();
1515
* device.setUARTCSVOutputEnabled(true);
16-
* device.storeSettingsInFlash() # Store the settings so they are not lost after a reset
16+
* device.persistSettings() # Store the settings so they are not lost after a reset
1717
*
1818
* Initial author: Sebastian Romero ([email protected])
1919
*

src/IndoorAirQualitySensor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class IndoorAirQualitySensor : public I2CDevice {
9797

9898
/**
9999
* @brief Set the mode of the IndoorAirQualitySensor.
100-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the mode to make the change persistent.
100+
* Call persistSettings() on NiclaSenseEnv instance after changing the mode to make the change persistent.
101101
*
102102
* Note on cleaning mode:
103103
* The cleaning mode performs a thermal cleaning cycle of the MOx element. It can eliminate some light pollution
@@ -136,7 +136,7 @@ class IndoorAirQualitySensor : public I2CDevice {
136136

137137
/**
138138
* @brief Set the sensor enabled or disabled.
139-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
139+
* Call persistSettings() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
140140
* @param isEnabled True to enable the sensor, false to disable it.
141141
*/
142142
void setEnabled(bool isEnabled);

src/NiclaSenseEnv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void NiclaSenseEnv::end() {
7373
}
7474
}
7575

76-
bool NiclaSenseEnv::storeSettingsInFlash() {
76+
bool NiclaSenseEnv::persistSettings() {
7777
uint8_t controlRegisterData = readFromRegister<uint8_t>(CONTROL_REGISTER_INFO);
7878

7979
writeToRegister(CONTROL_REGISTER_INFO, controlRegisterData | (1 << 7));
@@ -137,7 +137,7 @@ bool NiclaSenseEnv::restoreFactorySettings() {
137137
boardControlRegisterData = readFromRegister<uint8_t>(CONTROL_REGISTER_INFO);
138138

139139
if ((boardControlRegisterData & (1 << 5)) == 0) {
140-
return storeSettingsInFlash();
140+
return persistSettings();
141141
}
142142
Serial.println("⌛️ Waiting for factory reset to complete...");
143143
// Exponential sleep duration

src/NiclaSenseEnv.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class NiclaSenseEnv : public I2CDevice {
106106
*
107107
* @return true if the settings were successfully stored, false otherwise.
108108
*/
109-
bool storeSettingsInFlash();
109+
bool persistSettings();
110110

111111
/**
112112
* @brief Retrieves the serial number of the device.
@@ -148,7 +148,7 @@ class NiclaSenseEnv : public I2CDevice {
148148
/**
149149
* @brief Restores the factory settings.
150150
* This will reset among other properties the device address to the default value.
151-
* See storeSettingsInFlash() for a complete list of properties that are affected by this method.
151+
* See persistSettings() for a complete list of properties that are affected by this method.
152152
*
153153
* @return true if the factory settings were successfully restored, false otherwise.
154154
*/
@@ -163,7 +163,7 @@ class NiclaSenseEnv : public I2CDevice {
163163

164164
/**
165165
* @brief Sets the baud rate for the UART communication.
166-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the baud rate to make the change persistent.
166+
* Call persistSettings() on NiclaSenseEnv instance after changing the baud rate to make the change persistent.
167167
* @param baudRate The desired baud rate for the UART communication.
168168
The supported values are: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
169169
*/
@@ -179,7 +179,7 @@ class NiclaSenseEnv : public I2CDevice {
179179
/**
180180
* @brief Sets the UART CSV output enabled or disabled.
181181
* Enables or disables CSV output over UART.
182-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the CSV output mode to make the change persistent.
182+
* Call persistSettings() on NiclaSenseEnv instance after changing the CSV output mode to make the change persistent.
183183
*
184184
* The column names and their order are:
185185
* HS4001 sample counter, HS4001 temperature (degC), HS4001 humidity (%RH), ZMOD4510 status, ZMOD4510 sample counter,
@@ -205,7 +205,7 @@ class NiclaSenseEnv : public I2CDevice {
205205

206206
/**
207207
* @brief Sets the CSV delimiter for parsing CSV data.
208-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the CSV delimiter to make the change persistent.
208+
* Call persistSettings() on NiclaSenseEnv instance after changing the CSV delimiter to make the change persistent.
209209
* @param delimiter The character to be used as the CSV delimiter.
210210
*/
211211
void setCSVDelimiter(char delimiter);
@@ -220,14 +220,14 @@ class NiclaSenseEnv : public I2CDevice {
220220
/**
221221
* @brief Toggles the debugging mode.
222222
* When debugging mode is enabled, the board will send additional debug messages over UART.
223-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the debugging mode to make the change persistent.
223+
* Call persistSettings() on NiclaSenseEnv instance after changing the debugging mode to make the change persistent.
224224
* @param enabled A boolean value indicating whether debugging is enabled or not.
225225
*/
226226
void setDebuggingEnabled(bool enabled);
227227

228228
/**
229229
* @brief Sets the I2C address of the device.
230-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the address to make the change persistent.
230+
* Call persistSettings() on NiclaSenseEnv instance after changing the address to make the change persistent.
231231
*
232232
* @param address The new I2C address. Valid values are 0 to 127.
233233
*/

src/OrangeLED.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,21 @@ class OrangeLED : public I2CDevice {
3232

3333
/**
3434
* Sets the brightness of the orange LED.
35-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the orange LED brightness to make the change persistent.
35+
* Call persistSettings() on NiclaSenseEnv instance after changing the orange LED brightness to make the change persistent.
3636
* @param brightness : The brightness of the orange LED. Range is 0 to 63.
3737
*/
3838
void setBrightness(uint8_t brightness = 63);
3939

4040
/**
4141
* Determines whether the orange LED is used to indicate an error status of one of the sensors.
42+
* When a board error condition occurs the LED blinks, independently of the brightness setting.
4243
* @return True if the orange LED is used for error status, false otherwise.
4344
*/
4445
bool errorStatusEnabled();
4546

4647
/**
4748
* Enables or disables the orange LED to indicate an error status of one of the sensors.
48-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after enabling/disabling the orange LED error status to make the change persistent.
49+
* Call persistSettings() on NiclaSenseEnv instance after enabling/disabling the orange LED error status to make the change persistent.
4950
* @param enabled : Whether to enable or disable the orange LED error status.
5051
*/
5152
void setErrorStatusEnabled(bool enabled);

src/OutdoorAirQualitySensor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class OutdoorAirQualitySensor : public I2CDevice {
9595
* This function allows you to set the mode of the outdoor air quality sensor.
9696
* Possible values are: powerDown, cleaning, outdoorAirQuality.
9797
* See OutdoorAirQualitySensorMode for more information.
98-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the mode to make the change persistent.
98+
* Call persistSettings() on NiclaSenseEnv instance after changing the mode to make the change persistent.
9999
*
100100
* Note on cleaning mode:
101101
* The cleaning mode performs a thermal cleaning cycle of the MOx element. It can eliminate some light pollution
@@ -126,7 +126,8 @@ class OutdoorAirQualitySensor : public I2CDevice {
126126
/**
127127
* @brief Sets the enabled state of the outdoor air quality sensor.
128128
* When disabled the sensor goes in power down mode.
129-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
129+
* When the sensor is enabled after being disabled, the sensor will go back to the default mode.
130+
* Call persistSettings() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
130131
* @param isEnabled True to enable the sensor, false to disable it.
131132
*/
132133
void setEnabled(bool isEnabled);

src/RGBLED.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class RGBLED : public I2CDevice {
4242
/**
4343
* Enables the indoor air quality status indicator on the RGB LED.
4444
* When enabled, the RGB LED will change color based on the air quality (red = bad, green = good)
45-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after enabling the indoor air quality status to make the change persistent.
45+
* Call persistSettings() on NiclaSenseEnv instance after enabling the indoor air quality status to make the change persistent.
4646
* @param brightness The brightness level of the indicator (0-255).
4747
*/
4848
void enableIndoorAirQualityStatus(uint8_t brightness);
@@ -51,7 +51,7 @@ class RGBLED : public I2CDevice {
5151
* @brief Sets the RGB values of the LED.
5252
*
5353
* This function sets the red, green, and blue values of the LED using individual values.
54-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the color to make the change persistent.
54+
* Call persistSettings() on NiclaSenseEnv instance after changing the color to make the change persistent.
5555
* @param r The red value (0-255).
5656
* @param g The green value (0-255).
5757
* @param b The blue value (0-255).
@@ -60,7 +60,7 @@ class RGBLED : public I2CDevice {
6060

6161
/**
6262
* Sets the RGB values of the LED along with the specified brightness.
63-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the color to make the change persistent.
63+
* Call persistSettings() on NiclaSenseEnv instance after changing the color to make the change persistent.
6464
* @param r The red value (0-255).
6565
* @param g The green value (0-255).
6666
* @param b The blue value (0-255).
@@ -71,14 +71,14 @@ class RGBLED : public I2CDevice {
7171
/**
7272
* @brief Sets the RGB color of the LED using a Color object.
7373
* The Color object contains the red, green, and blue values that can be changed individually.
74-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the color to make the change persistent.
74+
* Call persistSettings() on NiclaSenseEnv instance after changing the color to make the change persistent.
7575
* @param color The RGB color to set.
7676
*/
7777
void setColor(Color color);
7878

7979
/**
8080
* @brief Sets the RGB color and brightness of the LED using a Color object.
81-
* Call Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the color / brightness to make the change persistent.
81+
* Call Call persistSettings() on NiclaSenseEnv instance after changing the color / brightness to make the change persistent.
8282
* @param color The desired RGB color.
8383
* @param brightness The desired brightness level (0-255).
8484
*/
@@ -101,7 +101,7 @@ class RGBLED : public I2CDevice {
101101
/**
102102
* @brief Sets the brightness of the RGB LED.
103103
* This function allows you to adjust the brightness of the RGB LED.
104-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the brightness to make the change persistent.
104+
* Call persistSettings() on NiclaSenseEnv instance after changing the brightness to make the change persistent.
105105
* @param brightness The brightness level to set (0-255).
106106
*/
107107
void setBrightness(uint8_t brightness);

src/TemperatureHumiditySensor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class TemperatureHumiditySensor : public I2CDevice {
6060
/**
6161
* @brief Sets the enabled state of the temperature and humidity sensor.
6262
* When disabled the sensor goes in power down mode.
63-
* Call storeSettingsInFlash() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
63+
* Call persistSettings() on NiclaSenseEnv instance after changing the enabled state to make the change persistent.
6464
* @param enabled The desired enabled state. True to enable the sensor, false to disable it.
6565
*/
6666
void setEnabled(bool enabled);

0 commit comments

Comments
 (0)