Run ESP_UniClock on the NixieIN12v2 clock

Adds CLOCK_90 and the nixie595.ino driver: two 74HC595s on hardware
SPI (GPIO13/14, latch GPIO15), multiplexed from an IRAM-only timer1
ISR. Neon dots on P1; P2 is the decimal-point line on this board.

Also:
- NeoPixel on any ESP8266 pin via bit-bang (GPIO12), and take the pin
  back after SPI.begin() claimed it as MISO
- ArduinoOTA (USE_ARDUINO_OTA), with an OTA upload env in platformio.ini
- DST: EU end date (last Sunday of October) instead of the first Sunday
  of November, and recompute the time from the rules when DST is
  toggled instead of shifting it by 1 h
- forward declarations so PlatformIO's .ino conversion compiles
- FIRMWARE_SERVER can be overridden; empty for CLOCK_90

Verified on the clock: tubes, order, dots, LEDs, LDR, NTP time with DST.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-25 21:23:10 +01:00
1 parent b347f1c63f
commit 0d3e878051
7 files changed
+304 -34

No files matched your search

@@ -100,13 +100,17 @@ inline byte tubeForPixel(int i) {
//than NeoEsp32Rmt7Ws2812xMethod, which can glitch the strict WS2812 bit
//timing (~1.25us/bit) if an ISR delays the RMT hardware mid-frame.
NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp32I2s1800KbpsMethod> strip(PixelCount+4,PixelPin); //NeoEsp32I2s1800KbpsMethod is used here because it is more reliable than NeoEsp32Rmt7Ws2812xMethod!
#else
#define NEOPIXEL_PIN 3
#elif NEOPIXEL_PIN == 3 //default (see clocks.h)
byte PixelPin = 3; // on 8266 it MUST use GPIO3 (RX pin)
//8266 has no I2S/RMT WS2812 helper here; Neo800KbpsMethod bit-bangs the
//protocol with cycle-counted delays, which is why GPIO3/RX is mandated -
//it's one of the few pins whose timing isn't disturbed by the UART/boot ROM.
NeoPixelBrightnessBus<NeoGrbFeature, Neo800KbpsMethod> strip(PixelCount+4);
#else
//Any other 8266 pin: cycle-counted bit-bang. Interrupts are off while Show()
//runs (about 30 us per pixel), which briefly delays the multiplex ISR.
byte PixelPin = NEOPIXEL_PIN;
NeoPixelBrightnessBus<NeoGrbFeature, NeoEsp8266BitBang800KbpsMethod> strip(PixelCount+4, PixelPin);
#endif
//Gamma-correction lookup table object - NOTE: currently declared but never
@@ -121,7 +125,10 @@ void setupNeopixel() {
DPRINT("Pixel count: "); DPRINTLN(PixelCount);
DPRINT("Brightness:"); DPRINT(c_MinBrightness); DPRINT(" - "); DPRINTLN(c_MaxBrightness);
neoBrightness = prm.rgbBrightness;
strip.Begin(); //initialize the underlying I2S/RMT/bit-bang driver and GPIO
//The bit-bang method sets the pin to OUTPUT in its constructor (before setup()), and Begin()
//does not. A driver may have claimed the pin since (nixie595.ino: SPI.begin() makes GPIO12 MISO).
pinMode(PixelPin, OUTPUT);
strip.Begin(); //initialize the underlying I2S/RMT/bit-bang driver and GPIO
strip.Show(); //push the (still all-black, default-constructed) buffer out so the strip starts dark, not showing stale/garbage pixel data
strip.SetBrightness(neoBrightness);
fixColor(prm.rgbFixColor); //apply the persisted fixed color immediately so the backlight is correct even before the first doAnimationMakuna() tick