Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/helpers/esp32/ESPNOWRadio.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "ESPNOWRadio.h"
#include <esp_now.h>
#include <esp_mac.h>
#include <WiFi.h>
#include <esp_wifi.h>

Expand All @@ -11,12 +12,20 @@ static uint8_t rx_buf[256];
static uint8_t last_rx_len = 0;

// callback when data is sent
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
static void OnDataSent(const esp_now_send_info_t *tx_info, esp_now_send_status_t status) {
#else
static void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
#endif
is_send_complete = true;
ESPNOW_DEBUG_PRINTLN("Send Status: %d", (int)status);
}

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
static void OnDataRecv(const esp_now_recv_info_t *info, const uint8_t *data, int len) {
#else
static void OnDataRecv(const uint8_t *mac, const uint8_t *data, int len) {
#endif
ESPNOW_DEBUG_PRINTLN("Recv: len = %d", len);
memcpy(rx_buf, data, len);
last_rx_len = len;
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/esp32/SerialBLEInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code
BLEDevice::setMTU(MAX_FRAME_SIZE);

BLESecurity sec;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
sec.setPassKey(true, pin_code);
#else
sec.setStaticPIN(pin_code);
#endif
sec.setAuthenticationMode(ESP_LE_AUTH_REQ_SC_MITM_BOND);

//BLEDevice::setPower(ESP_PWR_LVL_N8);
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/ui/SSD1306Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#include <helpers/RefCountedDigitalPin.h>

#ifndef PIN_OLED_RESET
#define PIN_OLED_RESET 21 // Reset pin # (or -1 if sharing Arduino reset pin)
#define PIN_OLED_RESET -1
#endif

#ifndef DISPLAY_ADDRESS
#define DISPLAY_ADDRESS 0x3C
#define DISPLAY_ADDRESS 0x3C
#endif

class SSD1306Display : public DisplayDriver {
Expand Down