Force start portal if cancel button is held on boot, fixes #36
This commit is contained in:
parent
27986fe27e
commit
9f22f09749
|
@ -82,6 +82,7 @@ bool cooldownCheck(long timeout) {
|
|||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial2.begin(115200, SERIAL_8N1, PIN_HWSERIAL_RX, PIN_HWSERIAL_TX);
|
||||
SPI.begin(PIN_HSPI_SCLK, PIN_HSPI_MISO, PIN_HSPI_MOSI);
|
||||
|
||||
ledcSetup(0, 5000, 12);
|
||||
pinMode(PIN_INTERRUPT_TRANSACT, INPUT_PULLUP);
|
||||
|
@ -92,11 +93,15 @@ void setup() {
|
|||
u8g2.begin();
|
||||
drawLogo(u8g2, LOGO_MATECARD);
|
||||
u8g2.sendBuffer();
|
||||
SPI.begin(PIN_HSPI_SCLK, PIN_HSPI_MISO, PIN_HSPI_MOSI);
|
||||
|
||||
SPIFFS.begin(true);
|
||||
WiFiSettings.hostname = "afrapay-";
|
||||
apiUrl = WiFiSettings.string("AfRApay.Web API", "http://192.168.50.170:5296");
|
||||
if (!digitalRead(PIN_INTERRUPT_CANCEL))
|
||||
WiFiSettings.portal();
|
||||
else
|
||||
WiFiSettings.connect();
|
||||
|
||||
rdm6300.begin(PIN_HWSERIAL_RX);
|
||||
rdm6300.set_tag_timeout(65);
|
||||
mfrc522.PCD_Init();
|
||||
|
|
Loading…
Reference in a new issue