mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-10 17:59:53 +03:00
rename valid_gpio_list to available_gpios
This commit is contained in:
@@ -144,7 +144,7 @@ class System {
|
||||
static bool saveSettings(const char * filename, const char * section, JsonObject input);
|
||||
|
||||
static bool add_gpio(uint8_t pin, const char * source_name);
|
||||
static std::vector<uint8_t> valid_gpio_list();
|
||||
static std::vector<uint8_t> available_gpios();
|
||||
static bool load_board_profile(std::vector<int8_t> & data, const std::string & board_profile);
|
||||
|
||||
static bool readCommand(const char * data);
|
||||
@@ -353,7 +353,7 @@ class System {
|
||||
}
|
||||
#endif
|
||||
|
||||
static void remove_gpio(uint8_t pin); // remove a gpio from both valid and used lists
|
||||
static void remove_gpio(uint8_t pin, bool also_system = false); // remove a gpio from both valid (optional) and used lists
|
||||
|
||||
private:
|
||||
static uuid::log::Logger logger_;
|
||||
|
||||
@@ -153,9 +153,9 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
||||
root["platform"] = EMSESP_PLATFORM;
|
||||
|
||||
// send back a list of valid and unused GPIOs still available for use
|
||||
JsonArray valid_gpio_list = root["valid_gpio_list"].to<JsonArray>();
|
||||
for (const auto & gpio : EMSESP::system_.valid_gpio_list()) {
|
||||
valid_gpio_list.add(gpio);
|
||||
JsonArray available_gpios = root["available_gpios"].to<JsonArray>();
|
||||
for (const auto & gpio : EMSESP::system_.available_gpios()) {
|
||||
available_gpios.add(gpio);
|
||||
}
|
||||
|
||||
response->setLength();
|
||||
|
||||
Reference in New Issue
Block a user