34 lines
624 B
C++
34 lines
624 B
C++
#include "state.h"
|
|
#include "config.h"
|
|
#include <EEPROM.h>
|
|
|
|
uint32_t ExposureTime = DefaultExposureTime;
|
|
uint8_t ExposureIntensity = DefaultExposureIntensity;
|
|
uint32_t ExposureTimerStart = 0;
|
|
|
|
|
|
void LoadSettings()
|
|
{
|
|
uint16_t offset = 0;
|
|
EEPROM.get(offset, ExposureTime);
|
|
offset += sizeof(ExposureTime);
|
|
|
|
EEPROM.get(offset, ExposureIntensity);
|
|
}
|
|
|
|
|
|
void SaveSettings()
|
|
{
|
|
uint16_t offset = 0;
|
|
EEPROM.put(offset, ExposureTime);
|
|
offset += sizeof(ExposureTime);
|
|
|
|
EEPROM.put(offset, ExposureIntensity);
|
|
}
|
|
|
|
|
|
void StartExposureTimer(unsigned long currentTime)
|
|
{
|
|
SaveSettings();
|
|
ExposureTimerStart = currentTime;
|
|
} |