From d49bdacd76594c0883f599a1e512006a8993760c Mon Sep 17 00:00:00 2001 From: Federico Scozzafava Date: Wed, 6 Jan 2021 22:24:24 +0100 Subject: [PATCH] reconnection issue fix --- nixie_firmware/src/drivers/tube_driver.cpp | 3 +++ nixie_firmware/src/network/wifi.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/nixie_firmware/src/drivers/tube_driver.cpp b/nixie_firmware/src/drivers/tube_driver.cpp index 4c732e4..b3e1441 100644 --- a/nixie_firmware/src/drivers/tube_driver.cpp +++ b/nixie_firmware/src/drivers/tube_driver.cpp @@ -127,6 +127,8 @@ void TubeDriver::set_tubes(int8_t h, int8_t hh, int8_t m, int8_t mm, int8_t s, i //prepare the data payload unsigned int payload = (ss & 0xF) | ((s & 0xF) << 4) | ((mm & 0xF) << 8) | ((m & 0xF) << 12) | ((hh & 0xF) << 16) | ((h & 0xF) << 20); // the LEDs don't change while you're sending in bits: + + noInterrupts(); digitalWrite(SHF_LATCH, LOW); // shift out the bits: shiftOut(SHF_DATA, SHF_CLOCK, LSBFIRST, payload); @@ -134,6 +136,7 @@ void TubeDriver::set_tubes(int8_t h, int8_t hh, int8_t m, int8_t mm, int8_t s, i shiftOut(SHF_DATA, SHF_CLOCK, LSBFIRST, payload >> 16); //take the latch pin high so the LEDs will light up: digitalWrite(SHF_LATCH, HIGH); + interrupts(); } void TubeDriver::adjust_brightness() diff --git a/nixie_firmware/src/network/wifi.cpp b/nixie_firmware/src/network/wifi.cpp index 102649b..ee144f3 100644 --- a/nixie_firmware/src/network/wifi.cpp +++ b/nixie_firmware/src/network/wifi.cpp @@ -197,6 +197,8 @@ void wifi_loop() { DEBUG_PRINTLN(F("Connection restored, stopping Config Portal.")); wifiManager.stopConfigPortal(); + wifiManager.server.get()->end(); + wifiManager.server.get()->begin(); wifiManager.startWebPortal(); }