From a82dc1b9da98df20764cecb70275816c00d91150 Mon Sep 17 00:00:00 2001 From: Rastislav Vysoky Date: Mon, 10 Aug 2026 20:13:59 +0200 Subject: [PATCH 1/2] make promicro pinmap more tidy, move the LoRa pins to variant.h --- variants/promicro/PromicroBoard.h | 13 ------------- variants/promicro/variant.cpp | 32 +++++++++++++++++++++++-------- variants/promicro/variant.h | 20 ++++++++++++++++--- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/variants/promicro/PromicroBoard.h b/variants/promicro/PromicroBoard.h index b190c47c81..ee16c9654b 100644 --- a/variants/promicro/PromicroBoard.h +++ b/variants/promicro/PromicroBoard.h @@ -4,19 +4,6 @@ #include #include -#define P_LORA_NSS 13 //P1.13 45 -#define P_LORA_DIO_1 11 //P0.10 10 -#define P_LORA_RESET 10 //P0.09 9 -#define P_LORA_BUSY 16 //P0.29 29 -#define P_LORA_MISO 15 //P0.02 2 -#define P_LORA_SCLK 12 //P1.11 43 -#define P_LORA_MOSI 14 //P1.15 47 -#define SX126X_POWER_EN 21 //P0.13 13 -#define SX126X_RXEN 2 //P0.17 -#define SX126X_TXEN RADIOLIB_NC -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE (1.8f) - #define PIN_VBAT_READ 17 #define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking diff --git a/variants/promicro/variant.cpp b/variants/promicro/variant.cpp index 0a4c3aac5b..b7d281acd9 100644 --- a/variants/promicro/variant.cpp +++ b/variants/promicro/variant.cpp @@ -3,13 +3,29 @@ #include "wiring_digital.h" const uint32_t g_ADigitalPinMap[] = { - 8, 6, 17, 20, 22, 24, 32, 11, 36, 38, - 9, 10, 43, 45, 47, 2, 29, 31, - 33, 34, 37, - 13, 15 + 8, // P0.08 = GPIO 0 + 6, // P0.06 = GPIO 1 + 17, // P0.17 = GPIO 2 + 20, // P0.20 = GPIO 3 + 22, // P0.22 = GPIO 4 + 24, // P0.24 = GPIO 5 + 32, // P1.00 = GPIO 6 + 11, // P0.11 = GPIO 7 + 36, // P1.04 = GPIO 8 + 38, // P1.06 = GPIO 9 + 9, // P0.09 = GPIO 10 + 10, // P0.10 = GPIO 11 + 43, // P1.11 = GPIO 12 + 45, // P1.13 = GPIO 13 + 47, // P1.15 = GPIO 14 + 2, // P0.02 = GPIO 15 + 29, // P0.29 = GPIO 16 + 31, // P0.31 = GPIO 17 + 33, // P1.01 = GPIO 18 + 34, // P1.02 = GPIO 19 + 37, // P1.05 = GPIO 20 + 13, // P0.13 = GPIO 21 + 15 // P0.15 = GPIO 22 }; -void initVariant() -{ -} - +void initVariant() {} diff --git a/variants/promicro/variant.h b/variants/promicro/variant.h index 98489da193..e8a7833169 100644 --- a/variants/promicro/variant.h +++ b/variants/promicro/variant.h @@ -7,9 +7,9 @@ #pragma once #include "WVariant.h" - + //////////////////////////////////////////////////////////////////////////////// - // Low frequency clock source + // Low frequency clock source #define VARIANT_MCK (64000000ul) @@ -79,4 +79,18 @@ #define PIN_BUTTON1 (6) #define BUTTON_PIN PIN_BUTTON1 - +////////////////////////////////////////////////////////////////////////////// +// LoRa + +#define P_LORA_NSS (13) +#define P_LORA_DIO_1 (11) +#define P_LORA_RESET (10) +#define P_LORA_BUSY (16) +#define P_LORA_MISO (15) +#define P_LORA_SCLK (12) +#define P_LORA_MOSI (14) +#define SX126X_POWER_EN (21) +#define SX126X_RXEN (2) +#define SX126X_TXEN (-1) +#define SX126X_DIO2_AS_RF_SWITCH true +#define SX126X_DIO3_TCXO_VOLTAGE (1.8f) From 5cce5cfe9766585fab8559054ebffd8933a847c4 Mon Sep 17 00:00:00 2001 From: Rastislav Vysoky Date: Tue, 11 Aug 2026 10:37:20 +0200 Subject: [PATCH 2/2] removed misleading 'GPIO' from pin numbers --- variants/promicro/variant.cpp | 46 +++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/variants/promicro/variant.cpp b/variants/promicro/variant.cpp index b7d281acd9..69b61745bd 100644 --- a/variants/promicro/variant.cpp +++ b/variants/promicro/variant.cpp @@ -3,29 +3,29 @@ #include "wiring_digital.h" const uint32_t g_ADigitalPinMap[] = { - 8, // P0.08 = GPIO 0 - 6, // P0.06 = GPIO 1 - 17, // P0.17 = GPIO 2 - 20, // P0.20 = GPIO 3 - 22, // P0.22 = GPIO 4 - 24, // P0.24 = GPIO 5 - 32, // P1.00 = GPIO 6 - 11, // P0.11 = GPIO 7 - 36, // P1.04 = GPIO 8 - 38, // P1.06 = GPIO 9 - 9, // P0.09 = GPIO 10 - 10, // P0.10 = GPIO 11 - 43, // P1.11 = GPIO 12 - 45, // P1.13 = GPIO 13 - 47, // P1.15 = GPIO 14 - 2, // P0.02 = GPIO 15 - 29, // P0.29 = GPIO 16 - 31, // P0.31 = GPIO 17 - 33, // P1.01 = GPIO 18 - 34, // P1.02 = GPIO 19 - 37, // P1.05 = GPIO 20 - 13, // P0.13 = GPIO 21 - 15 // P0.15 = GPIO 22 + 8, // P0.08 = 0 + 6, // P0.06 = 1 + 17, // P0.17 = 2 + 20, // P0.20 = 3 + 22, // P0.22 = 4 + 24, // P0.24 = 5 + 32, // P1.00 = 6 + 11, // P0.11 = 7 + 36, // P1.04 = 8 + 38, // P1.06 = 9 + 9, // P0.09 = 10 + 10, // P0.10 = 11 + 43, // P1.11 = 12 + 45, // P1.13 = 13 + 47, // P1.15 = 14 + 2, // P0.02 = 15 + 29, // P0.29 = 16 + 31, // P0.31 = 17 + 33, // P1.01 = 18 + 34, // P1.02 = 19 + 37, // P1.05 = 20 + 13, // P0.13 = 21 + 15 // P0.15 = 22 }; void initVariant() {}