diff --git a/include/Uhr.h b/include/Uhr.h index f96e30d1..adb6a287 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -160,7 +160,7 @@ uint32_t lastFrontMatrix[MAX_ROW_SIZE] = {0}; uint8_t minuteArray = 0; /* Using a byte as a per bit array */ uint8_t lastMinuteArray = 0; uint16_t minutePixelArray[4] = {0}; -uint64_t frameArray = 0; +bool frameArray[200] = {false}; bool parametersChanged = false; bool layoutChanged = false; bool colorChangedByWebsite = false; @@ -270,6 +270,7 @@ enum ClockType { Ger10x11Clock = 6, Ger10x11schwaebisch = 20, Ger10x11Nero = 11, + Ger10x11NeroFrame = 24, Ger11x11 = 3, Ger11x11V2 = 8, Ger11x11V3 = 14, diff --git a/include/Uhrtypes/DE10x11.nero.frame.hpp b/include/Uhrtypes/DE10x11.nero.frame.hpp new file mode 100644 index 00000000..c916290a --- /dev/null +++ b/include/Uhrtypes/DE10x11.nero.frame.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include "DE10x11.nero.hpp" + +/* + * Layout Front + * COL + * X 9 8 7 6 5 4 3 2 1 0 + * ROW + - - - - - - - - - - - + * 0 | E S J I S T L F Γ N F + * 1 | Z E H N Z W A N Z I G + * 2 | D R E I V I E R T E L + * 3 | T F N A C H V O R J M + * 4 | H A L B X Z W Γ L F T + * 5 | Z W E I N S I E B E N + * 6 | L D R E I C I F Γ N F + * 7 | E L F N E U N V I E R + * 8 | U A C H T Z E H N S I + * 9 | C S E C H S T L U H R + */ + +class De10x11NeroFrame_t : public De10x11Nero_t { +public: + virtual inline const uint8_t numPixelsFrameMatrix() { return 120; } + + //------------------------------------------------------------------------------ + + virtual const bool hasSecondsFrame() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const uint16_t getFrameMatrixIndex(uint16_t index) override { + return 114 + index; + }; + + //------------------------------------------------------------------------------ + + virtual const void getMinuteArray(uint16_t *returnArr, + uint8_t col) override { + for (uint8_t i = 0; i < 4; i++) { + returnArr[i] = 110 + i; + } + }; +}; + +De10x11NeroFrame_t _de10x11NeroFrame; \ No newline at end of file diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 2a71bda0..5774f5a5 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -109,6 +109,8 @@ iUhrType *ClockWork::getPointer(uint8_t type) { return &_de10x11Clock; case Ger10x11Nero: return &_de10x11Nero; + case Ger10x11NeroFrame: + return &_de10x11NeroFrame; case Nl10x11: return &_nl10x11; case Ger11x11: @@ -1236,7 +1238,7 @@ void ClockWork::loop(struct tm &tm) { case COMMAND_SET_TIME_MANUAL: { eeprom::write(); led.clear(); - frameArray = 0; + memset(frameArray, false, sizeof(frameArray)); parametersChanged = true; break; } @@ -1244,7 +1246,7 @@ void ClockWork::loop(struct tm &tm) { case COMMAND_SET_LAYOUT_VARIANT: { eeprom::write(); led.clear(); - frameArray = 0; + memset(frameArray, false, sizeof(frameArray)); layoutChanged = true; break; } @@ -1252,7 +1254,7 @@ void ClockWork::loop(struct tm &tm) { case COMMAND_SET_SETTING_SECOND: { eeprom::write(); led.clear(); - frameArray = 0; + memset(frameArray, false, sizeof(frameArray)); G.progInit = true; parametersChanged = true; break; diff --git a/include/frame.h b/include/frame.h index e0a3440a..fcee8fd3 100644 --- a/include/frame.h +++ b/include/frame.h @@ -45,17 +45,14 @@ SecondsFrame::SecondsFrame(const uint8_t num) { void SecondsFrame::setInitFrameSector() { switch (G.secondVariant) { - case SecondVariant::FrameSectorToggle: if (_minute % 2 == 1) { - for (uint8_t i = 0; i <= numFramePixels; i++) { - frameArray |= 1ULL << i; // Setting Bits - } + memset(frameArray, true, sizeof(numFramePixels)); } /* intentianally no break */ case SecondVariant::FrameSector: for (uint8_t i = 0; i <= _secondFrame; i++) { - frameArray ^= 1ULL << i; // Toggling Bits + frameArray[i] = !frameArray[i]; } break; default: @@ -81,36 +78,33 @@ void SecondsFrame::frameLogic() { /*Every full minute */ if (_secondFrame == numFramePixels) { led.clearFrame(); - frameArray = 0; + memset(frameArray, false, sizeof(frameArray)); setInitFrameSector(); _secondFrame = 0; } /*Every (Frame-)Second*/ if (lastSecondFrame != _secondFrame) { - switch (G.secondVariant) { case SecondVariant::FrameDot: - frameArray |= 1ULL << _secondFrame; // Setting Bit to 1 + frameArray[_secondFrame] = true; if (_secondFrame != 0) { - frameArray &= ~(1ULL << (_secondFrame - 1)); // Setting Bit to 0 + frameArray[_secondFrame - 1] = false; } break; case SecondVariant::FrameSector: case SecondVariant::FrameSectorToggle: - frameArray ^= 1ULL << _secondFrame; // Toggle Bit + frameArray[_secondFrame] = !frameArray[_secondFrame]; break; default: break; } - lastSecondFrame = _secondFrame; } /*Update LEDs corrosponding with mode Clockwork*/ if (G.prog == 0 && G.conf == 0) { led.clear(); - parametersChanged = true; G.prog = COMMAND_MODE_WORD_CLOCK; } } diff --git a/include/led.hpp b/include/led.hpp index 906dab96..2556daaf 100644 --- a/include/led.hpp +++ b/include/led.hpp @@ -311,10 +311,11 @@ void Led::setbyMinuteArray(ColorPosition colorPosition) { void Led::setbySecondArray(ColorPosition colorPosition) { HsbColor displayedColor; getColorbyPositionWithAppliedBrightness(displayedColor, colorPosition); + const uint8_t offesetSecondsFrame = + (usedUhrType->numPixelsFrameMatrix() / 8); - const uint8_t offesetSecondsFrame = 5; for (uint8_t i = 0; i < usedUhrType->numPixelsFrameMatrix(); i++) { - if ((frameArray >> i) & 1U) { + if (frameArray[i]) { if (i < usedUhrType->numPixelsFrameMatrix() - offesetSecondsFrame) { setPixel(usedUhrType->getFrameMatrixIndex(i) + offesetSecondsFrame, diff --git a/platformio.ini b/platformio.ini index 42c6cb4b..3021f073 100644 --- a/platformio.ini +++ b/platformio.ini @@ -45,7 +45,7 @@ lib_deps = makuna/NeoPixelBus@^2.7.6 bblanchon/ArduinoJson@^6.17.2 links2004/WebSockets@^2.4.1 - adafruit/RTClib@^1.11.2 + adafruit/RTClib@^1.11.2 knolleary/PubSubClient@^2.8.0 https://github.com/tzapu/WiFiManager#v2.0.17 claws/BH1750@^1.3.0 @@ -71,4 +71,4 @@ lib_deps = knolleary/PubSubClient@^2.8.0 https://github.com/tzapu/WiFiManager#v2.0.17 claws/BH1750@^1.3.0 -extra_scripts = pre:extra_scripts.py \ No newline at end of file +extra_scripts = pre:extra_scripts.py diff --git a/webpage/index.html b/webpage/index.html index 9769ffc9..ebd126dc 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -320,6 +320,7 @@
+ diff --git a/webpage/language/de.js b/webpage/language/de.js index 19d2dc25..2545675b 100644 --- a/webpage/language/de.js +++ b/webpage/language/de.js @@ -122,6 +122,7 @@ let TRANSLATION_DE_DE = { "de-10-11-vertical": "π©πͺ 10 Γ 11 Vertikal", "de-10-11-clock": "π©πͺ 10 Γ 11 Uhr", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Rahmen", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 SchwΓ€bisch", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 Version 2", diff --git a/webpage/language/en.js b/webpage/language/en.js index edca4dba..f8789d87 100644 --- a/webpage/language/en.js +++ b/webpage/language/en.js @@ -122,6 +122,7 @@ let TRANSLATION_EN_US = { "de-10-11-vertical": "π©πͺ 10 Γ 11 Vertical", "de-10-11-clock": "π©πͺ 10 Γ 11 Clock", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Frame", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 Swabian Style", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 Version 2", diff --git a/webpage/language/es.js b/webpage/language/es.js index 8e4ade57..71c56f25 100644 --- a/webpage/language/es.js +++ b/webpage/language/es.js @@ -98,6 +98,7 @@ let TRANSLATION_ES = { "de-10-11-vertical": "π©πͺ 10 Γ 11 Vertikal", "de-10-11-clock": "π©πͺ 10 Γ 11 Uhr", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Rahmen", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 Estilo suabo", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 Version 2", diff --git a/webpage/language/hu.js b/webpage/language/hu.js index ad9a25cb..f9166670 100644 --- a/webpage/language/hu.js +++ b/webpage/language/hu.js @@ -98,6 +98,7 @@ let TRANSLATION_HU = { "de-10-11-vertical": "π©πͺ 10 Γ 11 fΓΌggΕleges", "de-10-11-clock": "π©πͺ 10 Γ 11 Γ³ra", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero keretek", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 svΓ‘b stΓlus", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 verziΓ³ 2", diff --git a/webpage/language/it.js b/webpage/language/it.js index da47bbb5..8172dd44 100644 --- a/webpage/language/it.js +++ b/webpage/language/it.js @@ -98,6 +98,7 @@ let TRANSLATION_IT = { "de-10-11-vertical": "π©πͺ 10 Γ 11 Vertikal", "de-10-11-clock": "π©πͺ 10 Γ 11 Uhr", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Rahmen", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 Stile svevo", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 Version 2", diff --git a/webpage/language/nl.js b/webpage/language/nl.js index 206be880..98a6baa0 100644 --- a/webpage/language/nl.js +++ b/webpage/language/nl.js @@ -98,6 +98,7 @@ let TRANSLATION_NL = { "de-10-11-vertical": "π©πͺ 10 Γ 11 Verticaal", "de-10-11-clock": "π©πͺ 10 Γ 11 Clock", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Frame", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 Zwabische stijl", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 Versie 2", diff --git a/webpage/language/ru.js b/webpage/language/ru.js index 3684840a..2f67698c 100755 --- a/webpage/language/ru.js +++ b/webpage/language/ru.js @@ -86,6 +86,7 @@ let TRANSLATION_RU = { "de-10-11-vertical": "π©πͺ 10 Γ 11 ΠΠ΅ΡΡΠΈΠΊΠ°Π»ΡΠ½ΡΠΉ", "de-10-11-clock": "π©πͺ 10 Γ 11 Π§Π°ΡΡ", "de-10-11-nero": "π©πͺ 10 Γ 11 Nero", + "de-10-11-nero-frame": "π©πͺ 10 Γ 11 Nero Rahmen", "de-10-11-schwaebisch": "π©πͺ 10 Γ 11 Π¨Π²Π°Π±ΠΈΡ", "de-11-11": "π©πͺ 11 Γ 11", "de-11-11-v2": "π©πͺ 11 Γ 11 V2",