ESPHome  2024.11.2
ota_backend.cpp
Go to the documentation of this file.
1 #include "ota_backend.h"
2 
3 namespace esphome {
4 namespace ota {
5 
6 #ifdef USE_OTA_STATE_CALLBACK
7 OTAGlobalCallback *global_ota_callback{nullptr}; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
8 
10  if (global_ota_callback == nullptr) {
11  global_ota_callback = new OTAGlobalCallback(); // NOLINT(cppcoreguidelines-owning-memory)
12  }
13  return global_ota_callback;
14 }
15 
17 #endif
18 
19 } // namespace ota
20 } // namespace esphome
void register_ota_platform(OTAComponent *ota_caller)
Definition: ota_backend.cpp:16
OTAGlobalCallback * global_ota_callback
Definition: ota_backend.cpp:7
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void register_ota(OTAComponent *ota_caller)
Definition: ota_backend.h:77
OTAGlobalCallback * get_global_ota_callback()
Definition: ota_backend.cpp:9