mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-29 07:47:03 +02:00
* added config.h for general configuration
* added option to compile WiFi SSID + PWD to firmware * added option to configure WiFi access point name and password * added feature to retry connect to station WiFi (configurable timeouts) * updated index.html * added option for factory reset * added info about project on index.html * moved "update" and "home" to footer * fixed #23 HM1200 yield day unit * fixed DNS name of ESP after setup (some commits before)
This commit is contained in:
parent
c4b731708a
commit
539d4f73c1
16 changed files with 166 additions and 84 deletions
|
@ -52,9 +52,10 @@ class Main {
|
|||
return (crcCheck == crcRd);
|
||||
}
|
||||
|
||||
void eraseSettings(void) {
|
||||
void eraseSettings(bool all = false) {
|
||||
uint8_t buf[64] = {0};
|
||||
uint16_t addr = ADDR_START_SETTINGS, end;
|
||||
uint16_t addr = (all) ? ADDR_START : ADDR_START_SETTINGS;
|
||||
uint16_t end;
|
||||
do {
|
||||
end = addr += 64;
|
||||
if(end > (ADDR_SETTINGS_CRC + 2))
|
||||
|
@ -63,14 +64,14 @@ class Main {
|
|||
} while(addr < ADDR_START_SETTINGS);
|
||||
}
|
||||
|
||||
inline bool checkTicker(uint32_t *ticker, uint16_t *interval) {
|
||||
inline bool checkTicker(uint32_t *ticker, uint32_t interval) {
|
||||
uint32_t mil = millis();
|
||||
if(mil >= *ticker) {
|
||||
*ticker = mil + *interval;
|
||||
*ticker = mil + interval;
|
||||
return true;
|
||||
}
|
||||
else if(mil < (*ticker - *interval)) {
|
||||
*ticker = mil + *interval;
|
||||
else if(mil < (*ticker - interval)) {
|
||||
*ticker = mil + interval;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -87,7 +88,8 @@ class Main {
|
|||
char mDeviceName[DEVNAME_LEN];
|
||||
eep *mEep;
|
||||
uint32_t mTimestamp;
|
||||
|
||||
uint32_t mLimit;
|
||||
uint32_t mNextTryTs;
|
||||
|
||||
private:
|
||||
bool getConfig(void);
|
||||
|
@ -100,6 +102,7 @@ class Main {
|
|||
void showUptime(void);
|
||||
void showTime(void);
|
||||
void showCss(void);
|
||||
void showFactoryRst(void);
|
||||
|
||||
time_t getNtpTime(void);
|
||||
void sendNTPpacket(IPAddress& address);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue