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
6c4ef5bf
Commit
6c4ef5bf
authored
Feb 07, 2022
by
Eric Duminil
Browse files
Wifi.h only where needed.
parent
f8b87cdb
Pipeline
#5742
canceled with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/mqtt.cpp
View file @
6c4ef5bf
...
...
@@ -7,6 +7,12 @@
#include
"wifi_util.h"
#include
"src/lib/PubSubClient/src/PubSubClient.h"
#if defined(ESP8266)
# include <ESP8266WiFi.h>
#elif defined(ESP32)
# include <WiFi.h>
#endif
namespace
config
{
// Values should be defined in config.h
uint16_t
mqtt_sending_interval
=
MQTT_SENDING_INTERVAL
;
// [s]
...
...
ampel-firmware/util.cpp
View file @
6c4ef5bf
...
...
@@ -11,6 +11,7 @@ namespace config {
}
#if defined(ESP8266)
# include <ESP8266WiFi.h> // required to get MAC address
const
char
*
current_board
=
"ESP8266"
;
# if !defined(AMPEL_WIFI)
void
preinit
()
{
...
...
@@ -20,6 +21,7 @@ void preinit() {
}
# endif
#elif defined(ESP32)
# include <WiFi.h> // required to get MAC address
const
char
*
current_board
=
"ESP32"
;
#else
const
char
*
current_board
=
"UNKNOWN"
;
...
...
ampel-firmware/util.h
View file @
6c4ef5bf
#ifndef AMPEL_UTIL_H_INCLUDED
#define AMPEL_UTIL_H_INCLUDED
#include
<stdint.h>
// For uint32_t
#if defined(ESP8266)
# include <ESP8266WiFi.h> // required to get MAC address
# 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 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
...
...
ampel-firmware/wifi_util.cpp
View file @
6c4ef5bf
...
...
@@ -5,6 +5,12 @@
#include
"led_effects.h"
#include
"sensor_console.h"
#if defined(ESP8266)
# include <ESP8266WiFi.h>
#elif defined(ESP32)
# include <WiFi.h>
#endif
namespace
config
{
// WiFi config. See 'config.h' if you want to modify those values.
const
char
*
wifi_ssid
=
WIFI_SSID
;
...
...
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