Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
188a0bf3
Commit
188a0bf3
authored
4 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
ampel.max_loop_duration
parent
9a47750c
master
develop
experimental/example_for_iotwebconf
senseair_s8
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
archive/refactor/src_structure
archive/experimental/wifimanager
archive/experimental/simple
archive/experimental/save_lora_session
archive/experimental/save_config
archive/experimental/ota
archive/experimental/binary_clock
archive/experimental/autoconnect
archive/dev/debugcalib
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
ampel-firmware/ampel-firmware.ino
+3
-3
ampel-firmware/ampel-firmware.ino
ampel-firmware/util.cpp
+2
-4
ampel-firmware/util.cpp
ampel-firmware/util.h
+2
-2
ampel-firmware/util.h
ampel-firmware/web_server.cpp
+1
-1
ampel-firmware/web_server.cpp
with
8 additions
and
10 deletions
+8
-10
ampel-firmware/ampel-firmware.ino
+
3
-
3
View file @
188a0bf3
...
@@ -162,10 +162,10 @@ void loop() {
...
@@ -162,10 +162,10 @@ void loop() {
}
}
uint32_t
duration
=
millis
()
-
t0
;
uint32_t
duration
=
millis
()
-
t0
;
if
(
duration
>
max_loop_duration
)
{
if
(
duration
>
ampel
.
max_loop_duration
)
{
max_loop_duration
=
duration
;
ampel
.
max_loop_duration
=
duration
;
Serial
.
print
(
F
(
"Debug - Max loop duration : "
));
Serial
.
print
(
F
(
"Debug - Max loop duration : "
));
Serial
.
print
(
max_loop_duration
);
Serial
.
print
(
ampel
.
max_loop_duration
);
Serial
.
println
(
F
(
" ms."
));
Serial
.
println
(
F
(
" ms."
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware/util.cpp
+
2
-
4
View file @
188a0bf3
...
@@ -51,10 +51,8 @@ namespace ntp {
...
@@ -51,10 +51,8 @@ namespace ntp {
}
}
}
}
uint32_t
max_loop_duration
=
0
;
Ampel
::
Ampel
()
:
Ampel
::
Ampel
()
:
sensorId
(
"ESP"
+
macToID
())
{
sensorId
(
"ESP"
+
macToID
())
,
max_loop_duration
(
0
)
{
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
" 1618829570 (Sets time to the given UNIX time)"
);
sensor_console
::
defineIntCommand
(
"set_time"
,
ntp
::
setLocalTime
,
" 1618829570 (Sets time to the given UNIX time)"
);
sensor_console
::
defineCommand
(
"free"
,
[]()
{
sensor_console
::
defineCommand
(
"free"
,
[]()
{
Serial
.
print
(
F
(
"Free heap space : "
));
Serial
.
print
(
F
(
"Free heap space : "
));
...
@@ -63,4 +61,4 @@ Ampel::Ampel() :
...
@@ -63,4 +61,4 @@ Ampel::Ampel() :
},
" (Displays available heap space)"
);
},
" (Displays available heap space)"
);
}
}
const
Ampel
ampel
;
Ampel
ampel
;
This diff is collapsed.
Click to expand it.
ampel-firmware/util.h
+
2
-
2
View file @
188a0bf3
...
@@ -39,12 +39,12 @@ namespace util {
...
@@ -39,12 +39,12 @@ namespace util {
class
Ampel
{
class
Ampel
{
public:
public:
const
String
sensorId
;
const
String
sensorId
;
uint32_t
max_loop_duration
;
Ampel
();
Ampel
();
};
};
//NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over.
//NOTE: Only use seconds() for duration comparison, not timestamps comparison. Otherwise, problems happen when millis roll over.
#define seconds() (millis() / 1000UL)
#define seconds() (millis() / 1000UL)
extern
uint32_t
max_loop_duration
;
extern
Ampel
ampel
;
extern
const
Ampel
ampel
;
#endif
#endif
This diff is collapsed.
Click to expand it.
ampel-firmware/web_server.cpp
+
1
-
1
View file @
188a0bf3
...
@@ -239,7 +239,7 @@ namespace web_server {
...
@@ -239,7 +239,7 @@ namespace web_server {
#endif
#endif
config
::
temperature_offset
,
config
::
auto_calibrate_sensor
?
"Yes"
:
"No"
,
ampel
.
sensorId
.
c_str
(),
config
::
temperature_offset
,
config
::
auto_calibrate_sensor
?
"Yes"
:
"No"
,
ampel
.
sensorId
.
c_str
(),
ampel
.
sensorId
.
c_str
(),
WiFi
.
localIP
().
toString
().
c_str
(),
WiFi
.
localIP
().
toString
().
c_str
(),
ampel
.
sensorId
.
c_str
(),
WiFi
.
localIP
().
toString
().
c_str
(),
WiFi
.
localIP
().
toString
().
c_str
(),
get_free_heap_size
(),
max_loop_duration
,
BOARD
,
dd
,
hh
,
mm
,
ss
);
get_free_heap_size
(),
ampel
.
max_loop_duration
,
BOARD
,
dd
,
hh
,
mm
,
ss
);
Serial
.
print
(
F
(
" - Body size : "
));
Serial
.
print
(
F
(
" - Body size : "
));
http
.
sendContent
(
content
);
http
.
sendContent
(
content
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets