From 007d9ac2cb8e5ed452dc5fda38961ad0003d8eef Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 5 Mar 2023 16:42:48 +0100 Subject: [PATCH] [SX126x] Set SX1262 to accept SX1261 device string (#683) --- src/modules/SX126x/SX1262.h | 3 ++- src/modules/SX126x/SX126x.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/SX126x/SX1262.h b/src/modules/SX126x/SX1262.h index 108701b7..6da9e2a5 100644 --- a/src/modules/SX126x/SX1262.h +++ b/src/modules/SX126x/SX1262.h @@ -12,7 +12,8 @@ #define RADIOLIB_SX126X_PA_CONFIG_SX1262 0x00 //RADIOLIB_SX126X_REG_VERSION_STRING -#define RADIOLIB_SX1262_CHIP_TYPE 2 +// Note: this should really be "2", however, it seems that all SX1262 devices report as SX1261 +#define RADIOLIB_SX1262_CHIP_TYPE 1 /*! \class SX1262 diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 81cf1f5f..8b240407 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -1860,7 +1860,8 @@ bool SX126x::findChip(uint8_t ver) { RADIOLIB_DEBUG_PRINT(i + 1); RADIOLIB_DEBUG_PRINTLN(F(" of 10 tries) RADIOLIB_SX126X_REG_VERSION_STRING:")); _mod->hexdump((uint8_t*)version, 16, RADIOLIB_SX126X_REG_VERSION_STRING); - RADIOLIB_DEBUG_PRINTLN(); + RADIOLIB_DEBUG_PRINT(F("Expected string: ")); + RADIOLIB_DEBUG_PRINTLN(versionBuff); #endif _mod->delay(10); i++;