Files
esphome/tests/dummy_main.cpp
J. Nick Koston 649aec69d7 [logger] Make tx_buffer_ compile-time sized
Replace the heap-allocated tx_buffer_ (new char[]) with a compile-time
sized inline array using ESPHOME_LOGGER_TX_BUFFER_SIZE define. This
eliminates a heap allocation during Logger construction, saving ~513
bytes of heap on memory-constrained devices like BK72xx.

Changes:
- Add ESPHOME_LOGGER_TX_BUFFER_SIZE define set from Python config
- Change tx_buffer_ from char* to char[ESPHOME_LOGGER_TX_BUFFER_SIZE+1]
- Remove tx_buffer_size_ member field
- Update constructor to no longer take tx_buffer_size parameter
- Update all references to use the compile-time constant
2026-02-22 12:56:28 -06:00

35 lines
1.0 KiB
C++

// Dummy main.cpp file for the PlatformIO project in the git repository.
// Primarily used to get IDE integration working (so the contents here don't
// matter at all, as long as it compiles).
// Not used during runtime nor for CI.
#include <esphome/components/gpio/switch/gpio_switch.h>
#include <esphome/components/logger/logger.h>
#include <esphome/components/esphome/ota/ota_esphome.h>
#include <esphome/components/wifi/wifi_component.h>
#include <esphome/core/application.h>
using namespace esphome;
void setup() {
App.pre_setup("livingroom", "LivingRoom", false);
auto *log = new logger::Logger(115200); // NOLINT
log->pre_setup();
log->set_uart_selection(logger::UART_SELECTION_UART0);
App.register_component(log);
auto *wifi = new wifi::WiFiComponent(); // NOLINT
App.register_component(wifi);
wifi::WiFiAP ap;
ap.set_ssid("Test SSID");
ap.set_password("password1");
wifi->add_sta(ap);
auto *ota = new esphome::ESPHomeOTAComponent(); // NOLINT
ota->set_port(8266);
App.setup();
}
void loop() { App.loop(); }