Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Käppler
ampel-firmware
Commits
8b316b1a
Commit
8b316b1a
authored
Jan 09, 2021
by
Eric Duminil
Browse files
Fixing buggy millis use
parent
fe8c9332
Changes
2
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/led_effects.cpp
View file @
8b316b1a
...
...
@@ -146,8 +146,7 @@ namespace led_effects {
static
uint16_t
wheel_offset
=
0
;
unsigned
long
t0
=
millis
();
pixels
.
setBrightness
(
config
::
max_brightness
);
//FIXME: OVERFLOW!
while
(
millis
()
<
t0
+
duration_ms
)
{
while
(
millis
()
-
t0
<
duration_ms
)
{
for
(
int
i
=
0
;
i
<
NUMPIXELS
;
i
++
)
{
pixels
.
setPixelColor
(
i
,
pixels
.
ColorHSV
(
i
*
65535
/
NUMPIXELS
+
wheel_offset
));
wheel_offset
+=
hue_increment
;
...
...
ampel-firmware/lorawan.cpp
View file @
8b316b1a
...
...
@@ -184,8 +184,7 @@ namespace lorawan {
void
preparePayloadIfTimeHasCome
(
const
int16_t
&
co2
,
const
float
&
temperature
,
const
float
&
humidity
)
{
static
unsigned
long
last_sent_at
=
0
;
unsigned
long
now
=
seconds
();
//FIXME: OVERFLOW!
if
(
connected
&&
(
now
>
last_sent_at
+
config
::
lorawan_sending_interval
))
{
if
(
connected
&&
(
now
-
last_sent_at
>
config
::
lorawan_sending_interval
))
{
last_sent_at
=
now
;
preparePayload
(
co2
,
temperature
,
humidity
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment