Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
65ce6ee8
Commit
65ce6ee8
authored
Apr 22, 2021
by
Eric Duminil
Browse files
More heap info
parent
dc43e04e
Pipeline
#3213
passed with stage
in 1 minute and 38 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/util.cpp
View file @
65ce6ee8
...
...
@@ -52,8 +52,14 @@ namespace ntp {
void
Ampel
::
showFreeSpace
()
{
Serial
.
print
(
F
(
"Free heap space : "
));
Serial
.
print
(
get
_f
ree
_h
eap
_size
());
Serial
.
print
(
ESP
.
get
F
ree
H
eap
());
Serial
.
println
(
F
(
" bytes."
));
Serial
.
print
(
F
(
"Max free block size : "
));
Serial
.
print
(
esp_get_max_free_block_size
());
Serial
.
println
(
F
(
" bytes."
));
Serial
.
print
(
F
(
"Heap fragmentation : "
));
Serial
.
print
(
esp_get_heap_fragmentation
());
Serial
.
println
(
F
(
" %"
));
}
char
sensorId
[
10
];
// e.g "ESPxxxxxx\0"
...
...
ampel-firmware/util.h
View file @
65ce6ee8
...
...
@@ -9,10 +9,12 @@
#if defined(ESP8266)
# include <ESP8266WiFi.h> // required to get MAC address
# define get_free_heap_size() system_get_free_heap_size()
# define esp_get_max_free_block_size() ESP.getMaxFreeBlockSize()
# define esp_get_heap_fragmentation() ESP.getHeapFragmentation()
#elif defined(ESP32)
# include <WiFi.h> // required to get MAC address
# define get_free_heap_size() esp_get_free_heap_size()
# define esp_get_max_free_block_size() ESP.getMaxAllocHeap() //largest block of heap that can be allocated.
# define esp_get_heap_fragmentation() "?" // apparently not available for ESP32
#endif
namespace
ntp
{
...
...
ampel-firmware/web_server.cpp
View file @
65ce6ee8
...
...
@@ -112,6 +112,7 @@ namespace web_server {
"<tr><td>Local address</td><td><a href='http://%s.local/'>%s.local</a></td></tr>
\n
"
"<tr><td>Local IP</td><td><a href='http://%s'>%s</a></td></tr>
\n
"
"<tr><td>Free heap space</td><td>%6d bytes</td></tr>
\n
"
"<tr><td>Largest heap block</td><td>%6d bytes</td></tr>
\n
"
"<tr><td>Max loop duration</td><td>%5d ms</td></tr>
\n
"
"<tr><td>Board</td><td>%s</td></tr>
\n
"
"<tr><td>Uptime</td><td>%2d d %4d h %02d min %02d s</td></tr>
\n
"
...
...
@@ -237,7 +238,8 @@ namespace web_server {
config
::
lorawan_sending_interval
,
#endif
config
::
temperature_offset
,
config
::
auto_calibrate_sensor
?
"Yes"
:
"No"
,
ampel
.
sensorId
,
ampel
.
sensorId
,
wifi
::
local_ip
,
wifi
::
local_ip
,
get_free_heap_size
(),
ampel
.
max_loop_duration
,
ampel
.
board
,
dd
,
hh
,
mm
,
ss
);
wifi
::
local_ip
,
wifi
::
local_ip
,
ESP
.
getFreeHeap
(),
esp_get_max_free_block_size
(),
ampel
.
max_loop_duration
,
ampel
.
board
,
dd
,
hh
,
mm
,
ss
);
Serial
.
print
(
F
(
" - Body size : "
));
http
.
sendContent
(
content
);
...
...
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