mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-29 21:40:50 +00:00
Only check for "holding down reset button" if button is available
This commit is contained in:
@@ -28,22 +28,28 @@ void HanConfigAp::setup(int accessPointButtonPin, Stream* debugger)
|
||||
config.load();
|
||||
if (this->debugger) config.print(this->debugger);
|
||||
|
||||
// Test if we're holding down the AP pin, over 5 seconds
|
||||
int time = millis() + 5000;
|
||||
print("Press the AP button now to boot as access point");
|
||||
while (millis() < time)
|
||||
if (accessPointButtonPin != INVALID_BUTTON_PIN)
|
||||
{
|
||||
print(".");
|
||||
if (digitalRead(accessPointButtonPin) == LOW)
|
||||
// Assign pin for boot as AP
|
||||
pinMode(accessPointButtonPin, INPUT_PULLUP);
|
||||
|
||||
// Test if we're holding down the AP pin, over 5 seconds
|
||||
int time = millis() + 5000;
|
||||
print("Press the AP button now to boot as access point");
|
||||
while (millis() < time)
|
||||
{
|
||||
print("AP button was pressed. Booting as access point now. Look for SSID ");
|
||||
println(this->AP_SSID);
|
||||
isActivated = true;
|
||||
break;
|
||||
print(".");
|
||||
if (digitalRead(accessPointButtonPin) == LOW)
|
||||
{
|
||||
print("AP button was pressed. Booting as access point now. Look for SSID ");
|
||||
println(this->AP_SSID);
|
||||
isActivated = true;
|
||||
break;
|
||||
}
|
||||
delay(100);
|
||||
}
|
||||
delay(100);
|
||||
println("");
|
||||
}
|
||||
println("");
|
||||
}
|
||||
|
||||
if (isActivated)
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#include <DNSServer.h>
|
||||
#include "configuration.h"
|
||||
|
||||
#define INVALID_BUTTON_PIN 0xFFFFFFFF
|
||||
|
||||
class HanConfigAp {
|
||||
public:
|
||||
void setup(int accessPointButtonPin, Stream* debugger);
|
||||
|
||||
Reference in New Issue
Block a user