compatibility for esp32
This commit is contained in:
parent
221a2f45bd
commit
80e1d1599d
2 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
#include "WebServer.h"
|
#include "WebServer.h"
|
||||||
#include "WebServerSecure.h"
|
|
||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
#include "ESP8266WebServer.h"
|
#include "ESP8266WebServer.h"
|
||||||
#include "ESP8266WebServerSecure.h"
|
#include "ESP8266WebServerSecure.h"
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace fw
|
||||||
|
|
||||||
uint16_t Storage::eeprom_rule_position(uint8_t key)
|
uint16_t Storage::eeprom_rule_position(uint8_t key)
|
||||||
{
|
{
|
||||||
|
#ifdef ESP8266
|
||||||
firewall_rule_t rule;
|
firewall_rule_t rule;
|
||||||
uint8_t total_space_needed = 0;
|
uint8_t total_space_needed = 0;
|
||||||
total_space_needed += sizeof(rule.source);
|
total_space_needed += sizeof(rule.source);
|
||||||
|
@ -50,6 +51,9 @@ namespace fw
|
||||||
total_space_needed += sizeof(rule.protocol);
|
total_space_needed += sizeof(rule.protocol);
|
||||||
// key-1 because key will be in range 1-255, but we need 1 less for multiplication
|
// key-1 because key will be in range 1-255, but we need 1 less for multiplication
|
||||||
return eeprom_rules_head + (key - 1) * total_space_needed;
|
return eeprom_rules_head + (key - 1) * total_space_needed;
|
||||||
|
#elif defined(ESP32)
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Storage::retrieve_settings_value(const char *key)
|
uint8_t Storage::retrieve_settings_value(const char *key)
|
||||||
|
|
Reference in a new issue