Skip to content

Commit fa9b7be

Browse files
authored
Merge pull request #180 from dbambus/main
A few Updates for 2.6.2 Release :-)
2 parents 8047ac3 + 3c1e457 commit fa9b7be

File tree

10 files changed

+693
-392
lines changed

10 files changed

+693
-392
lines changed

include/Animation.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ struct RgbfColor : RgbColor {
2121
RgbfColor(uint8_t r, uint8_t g, uint8_t b) : RgbColor(r, g, b) {
2222
Flags = F_NULL;
2323
}
24-
RgbfColor(RgbColor rgb, uint f) : RgbColor(rgb) { Flags = f; }
25-
RgbfColor(HsbColor hsb, uint f) : RgbColor(hsb) { Flags = f; }
26-
RgbfColor(uint8_t h, uint f) : RgbColor(h) { Flags = f; }
24+
RgbfColor(RgbColor rgb, uint32_t f) : RgbColor(rgb) { Flags = f; }
25+
RgbfColor(HsbColor hsb, uint32_t f) : RgbColor(hsb) { Flags = f; }
26+
RgbfColor(uint8_t h, uint32_t f) : RgbColor(h) { Flags = f; }
2727

2828
void changeRgb(RgbColor color) {
2929
R = color.R;
@@ -56,15 +56,15 @@ struct RgbfColor : RgbColor {
5656
uint8_t getFlags() { return Flags; }
5757

5858
protected:
59-
uint Flags;
59+
uint32_t Flags;
6060
};
6161
struct RgbaColor : RgbfColor {
6262
RgbaColor() : RgbfColor() { Alpha = 255; };
6363
RgbaColor(RgbColor rgb) : RgbfColor(rgb) { Alpha = 255; }
6464
RgbaColor(uint8_t h) : RgbfColor(h) { Alpha = 255; }
65-
RgbaColor(RgbColor rgb, uint f) : RgbfColor(rgb, f) { Alpha = 255; }
66-
RgbaColor(HsbColor hsb, uint f) : RgbfColor(hsb, f) { Alpha = 255; }
67-
RgbaColor(uint8_t h, uint f) : RgbfColor(h, f) { Alpha = 255; }
65+
RgbaColor(RgbColor rgb, uint32_t f) : RgbfColor(rgb, f) { Alpha = 255; }
66+
RgbaColor(HsbColor hsb, uint32_t f) : RgbfColor(hsb, f) { Alpha = 255; }
67+
RgbaColor(uint8_t h, uint32_t f) : RgbfColor(h, f) { Alpha = 255; }
6868
// ---------------------
6969
RgbaColor(RgbColor rgb, float a) : RgbfColor(rgb) {
7070
Alpha = (uint8_t)(a * 255);
@@ -122,7 +122,7 @@ class Animation {
122122
protected:
123123
uint16_t phase = 0;
124124
bool matrixChanged = false;
125-
uint animationDelay = 100;
125+
uint32_t animationDelay = 100;
126126
Animation_t animType = KEINE;
127127
uint32_t nextActionTime = 0;
128128
uint8_t lastMinute = 100;
@@ -198,7 +198,7 @@ class Rain {
198198
}
199199
virtual ~Rain(){};
200200

201-
void begin(int frames, int stop, uint8_t helligkeit) {
201+
void begin(int32_t frames, int32_t stop, uint8_t helligkeit) {
202202
white = RgbaColor(helligkeit, 1.0f);
203203
// white.Lighten(helligkeit);
204204
green = RgbaColor(0, helligkeit, 0, 0.5);
@@ -217,11 +217,11 @@ class Rain {
217217
stopPhase = frames - speedlimit * max_rows;
218218
}
219219

220-
RgbaColor get(int r) {
221-
int row = (max_rows - 1 - r);
220+
RgbaColor get(int32_t r) {
221+
int32_t row = (max_rows - 1 - r);
222222
// pro Bild laeuft row von (max_rows - 1) runter auf 0
223223

224-
int pos = (row + offset) % (deadtime + lifetime);
224+
int32_t pos = (row + offset) % (deadtime + lifetime);
225225

226226
if (row == 0) { // letzte row faer dieses Bild
227227
if (phase++ == stopPhase) {
@@ -263,8 +263,8 @@ class Rain {
263263

264264
protected:
265265
uint8_t max_rows, max_cols;
266-
int speed, speedlimit, offset, lifetime, deadtime;
267-
int phase, frames, stopPhase, stopLine, stopTop, stopBottom;
266+
int32_t speed, speedlimit, offset, lifetime, deadtime;
267+
int32_t phase, frames, stopPhase, stopLine, stopTop, stopBottom;
268268
bool stopping;
269269
RgbaColor white = RgbaColor(255, 255, 255, 0.9);
270270
RgbaColor green = RgbaColor(0, 255, 0, 0.75);
@@ -282,8 +282,8 @@ class Ball {
282282
}
283283
virtual ~Ball(){};
284284

285-
void begin(int row, int column, RgbfColor foreground, RgbfColor background,
286-
int delay) {
285+
void begin(int32_t row, int32_t column, RgbfColor foreground,
286+
RgbfColor background, int32_t delay) {
287287
this->delay = delay;
288288
y = row << 8; // increase precision
289289
r = row;
@@ -300,11 +300,11 @@ class Ball {
300300
// x = 0, y = 0 -> links oben
301301
// x = 10, y = 9 -> rechts unten
302302
// v positiv -> nach unten
303-
int move(int timedelta) {
303+
int32_t move(int32_t timedelta) {
304304
if (!end) {
305305
delay -= timedelta;
306306
if (delay <= 0) {
307-
int _vy = vy;
307+
int32_t _vy = vy;
308308
y += (((g * timedelta) / 1000) * timedelta) / 2000 +
309309
(vy * timedelta) / 1000;
310310
vy += (g * timedelta) / 1000;
@@ -325,13 +325,13 @@ class Ball {
325325
}
326326

327327
public:
328-
int r, c; // after calling move() r and c contain new actual values
328+
int32_t r, c; // after calling move() r and c contain new actual values
329329
RgbfColor color;
330330

331331
protected:
332-
int unten;
333-
int lastPos;
334-
int g, vy, y, end, delay;
332+
int32_t unten;
333+
int32_t lastPos;
334+
int32_t g, vy, y, end, delay;
335335
bool lastDown;
336336
RgbfColor colorForeground, colorBackground;
337337
};
@@ -365,7 +365,7 @@ class Snake {
365365
GoToPos *motions;
366366
Coord head;
367367
bool goRight;
368-
int index;
368+
int32_t index;
369369
std::queue<Coord> snake;
370370
RgbfColor **work;
371371
RgbfColor **old;
@@ -418,7 +418,7 @@ class Snake {
418418
while (rowCounter-- > 0) {
419419
left = max_cols;
420420
right = 0;
421-
for (int col = 0; col < max_cols; col++) {
421+
for (int32_t col = 0; col < max_cols; col++) {
422422
if (matrix[row][col].isForeground()) {
423423
// search for right most foreground
424424
right = col;
@@ -485,7 +485,7 @@ class Firework {
485485
RgbColor colors[3];
486486
Icons icons[3];
487487
bool mirrored;
488-
int maxLayer;
488+
int32_t maxLayer;
489489
uint8_t max_rows, max_cols;
490490

491491
public:
@@ -495,7 +495,7 @@ class Firework {
495495
}
496496

497497
// layers must be prepared in ascending order !!!
498-
void prepare(int layer, RgbColor &color, Icons icon, bool mirrored) {
498+
void prepare(int32_t layer, RgbColor &color, Icons icon, bool mirrored) {
499499
if (layer == 0) {
500500
icons[1] = static_cast<Icons>(0);
501501
icons[2] = static_cast<Icons>(0);
@@ -507,13 +507,13 @@ class Firework {
507507
}
508508

509509
bool getPixel(uint8_t r, uint8_t c, RgbColor &color) {
510-
// void Animation::copyBlock(RgbfColor color, uint block, bool fgbg,
510+
// void Animation::copyBlock(RgbfColor color, uint32_t block, bool fgbg,
511511
// bool mirrored,
512512
// bool init) {
513513

514514
if ((r < 10) && (r < max_rows) && (c < 11) && (c < max_cols)) {
515515
uint16_t pixels = 0;
516-
for (int layer = 0; layer <= maxLayer; layer++) {
516+
for (int32_t layer = 0; layer <= maxLayer; layer++) {
517517
if (icons[layer] != static_cast<Icons>(0)) {
518518
pixels = animation->reverse(
519519
pgm_read_word(&(grafik_11x10[icons[layer]][r])),

include/Uhr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ enum UhrTypeDefinitions {
216216
Uhr_114 = 1,
217217
Uhr_114_Alternative = 2,
218218
Uhr_114_2Clock = 6,
219+
Uhr_114_Dutch = 9,
219220
Uhr_125 = 3,
220221
Uhr_125_Type2 = 8,
221222
Uhr_169 = 4,
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
#include "Uhrtype.hpp"
2+
3+
/*
4+
* Layout Front
5+
*
6+
* H E T R I S L V I J F
7+
* T I E N Z J A R U A G
8+
* D R I E S K W A R T N
9+
* F T O V E R V O O R M
10+
* H A L F X T W A A L F
11+
* T W E E N Z E V E N P
12+
* L D R I E B Y V I J F
13+
* E L F A C H T V I E R
14+
* N E G E N P M T I E N
15+
* O S Z E S T L P U U R
16+
*
17+
*/
18+
19+
class UHR_114_dutch_t : public iUhrType {
20+
public:
21+
const uint16_t min_arr[2][4] = {
22+
// ergänzt aus "Uhr func 169"-datei
23+
{110, 111, 112, 113}, // LED für Minuten Anzeige Zeile
24+
{110, 111, 112, 113} // LED für Minuten Anzeige Ecken
25+
};
26+
27+
//------------------------------------------------------------------------------
28+
29+
virtual const uint16_t getMinArr(uint8_t col, uint8_t row) override {
30+
return min_arr[col][row];
31+
};
32+
33+
//------------------------------------------------------------------------------
34+
35+
virtual const bool hasZwanzig() override { return false; }
36+
37+
//------------------------------------------------------------------------------
38+
39+
void show(uint8_t text) override {
40+
switch (text) {
41+
42+
case es_ist:
43+
// Es
44+
Letter_set(0);
45+
Letter_set(1);
46+
Letter_set(2);
47+
48+
// Ist
49+
Letter_set(4);
50+
Letter_set(5);
51+
break;
52+
53+
case nach:
54+
case v_nach:
55+
Letter_set(41);
56+
Letter_set(40);
57+
Letter_set(39);
58+
Letter_set(38);
59+
break;
60+
61+
case vor:
62+
case v_vor:
63+
Letter_set(37);
64+
Letter_set(36);
65+
Letter_set(35);
66+
Letter_set(34);
67+
break;
68+
69+
case viertel:
70+
Letter_set(27);
71+
Letter_set(28);
72+
Letter_set(29);
73+
Letter_set(30);
74+
break;
75+
76+
case fuenf:
77+
Letter_set(7);
78+
Letter_set(8);
79+
Letter_set(9);
80+
Letter_set(10);
81+
break;
82+
83+
case zehn:
84+
Letter_set(21);
85+
Letter_set(20);
86+
Letter_set(19);
87+
Letter_set(18);
88+
break;
89+
90+
case halb:
91+
Letter_set(44);
92+
Letter_set(45);
93+
Letter_set(46);
94+
Letter_set(47);
95+
break;
96+
97+
case h_ein:
98+
Letter_set(63);
99+
Letter_set(62);
100+
Letter_set(61);
101+
break;
102+
103+
case uhr:
104+
Letter_set(101);
105+
Letter_set(100);
106+
Letter_set(99);
107+
break;
108+
109+
case h_zwei:
110+
Letter_set(65);
111+
Letter_set(64);
112+
Letter_set(63);
113+
Letter_set(62);
114+
break;
115+
116+
case h_drei:
117+
Letter_set(67);
118+
Letter_set(68);
119+
Letter_set(69);
120+
Letter_set(70);
121+
break;
122+
123+
case h_vier:
124+
Letter_set(80);
125+
Letter_set(79);
126+
Letter_set(78);
127+
Letter_set(77);
128+
break;
129+
130+
case h_fuenf:
131+
Letter_set(73);
132+
Letter_set(74);
133+
Letter_set(75);
134+
Letter_set(76);
135+
break;
136+
137+
case h_sechs:
138+
Letter_set(107);
139+
Letter_set(106);
140+
Letter_set(105);
141+
break;
142+
143+
case h_sieben:
144+
Letter_set(60);
145+
Letter_set(59);
146+
Letter_set(58);
147+
Letter_set(57);
148+
Letter_set(56);
149+
break;
150+
151+
case h_acht:
152+
Letter_set(84);
153+
Letter_set(83);
154+
Letter_set(82);
155+
Letter_set(81);
156+
break;
157+
158+
case h_neun:
159+
Letter_set(88);
160+
Letter_set(89);
161+
Letter_set(90);
162+
Letter_set(91);
163+
Letter_set(92);
164+
break;
165+
166+
case h_zehn:
167+
Letter_set(95);
168+
Letter_set(96);
169+
Letter_set(97);
170+
Letter_set(98);
171+
break;
172+
173+
case h_elf:
174+
Letter_set(87);
175+
Letter_set(86);
176+
Letter_set(85);
177+
break;
178+
179+
case h_zwoelf:
180+
Letter_set(49);
181+
Letter_set(50);
182+
Letter_set(51);
183+
Letter_set(52);
184+
Letter_set(53);
185+
Letter_set(54);
186+
break;
187+
188+
default:
189+
break;
190+
};
191+
};
192+
};

include/uhr_func.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ bool changes_in_array() {
187187

188188
//------------------------------------------------------------------------------
189189

190-
void led_set_Icon(uint8 num_icon, uint8_t brightness = 100,
190+
void led_set_Icon(uint8_t num_icon, uint8_t brightness = 100,
191191
bool rgb_icon = false) {
192192
uint8_t rr, gg, bb, ww;
193193
set_helligkeit(rr, gg, bb, ww, Foreground, brightness);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Wortuhr",
3-
"version": "2.6.0",
3+
"version": "2.6.2",
44
"description": "For building a german layouted wordclock with an esp8266 module and WS2812/SK2812.",
55
"license": "BSD-3-Clause",
66
"contributors": [

0 commit comments

Comments
 (0)