Define USE_PSRAM (#6526)

This commit is contained in:
Edward Firmo 2024-04-15 07:13:31 +02:00 committed by GitHub
parent 0e3021b5f8
commit 6876c65eda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -2,6 +2,7 @@
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#include <array>
@ -248,11 +249,11 @@ class ESP32BLETracker : public Component,
SemaphoreHandle_t scan_result_lock_;
SemaphoreHandle_t scan_end_lock_;
size_t scan_result_index_{0};
#if CONFIG_SPIRAM
#ifdef USE_PSRAM
const static u_int8_t SCAN_RESULT_BUFFER_SIZE = 32;
#else
const static u_int8_t SCAN_RESULT_BUFFER_SIZE = 16;
#endif // CONFIG_SPIRAM
#endif // USE_PSRAM
esp_ble_gap_cb_param_t::ble_scan_result_evt_param *scan_result_buffer_;
esp_bt_status_t scan_start_failed_{ESP_BT_STATUS_SUCCESS};
esp_bt_status_t scan_set_param_failed_{ESP_BT_STATUS_SUCCESS};

View file

@ -54,5 +54,7 @@ async def to_code(config):
if CONF_SPEED in config:
add_idf_sdkconfig_option(f"{SPIRAM_SPEEDS[config[CONF_SPEED]]}", True)
cg.add_define("USE_PSRAM")
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)