From 04768f460ac18950e8c98d6c22bf9a95c79f4a1b Mon Sep 17 00:00:00 2001 From: "Morgan 'ARR\\!' Allen" Date: Sun, 24 May 2020 11:30:08 -0700 Subject: [PATCH] actually take default values from Kconfig --- Kconfig | 21 +++++++++++++++++++++ main/esp32-lora.c | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Kconfig b/Kconfig index 9ee3aa0..41791c7 100644 --- a/Kconfig +++ b/Kconfig @@ -24,3 +24,24 @@ config LORA32_DIO0_PIN default 26 help GPIO to handle DIO0 + +config LORA32_MISO_PIN + int "GPIO to handle MISO" + depends on LORA32_ENABLED + default 19 + help + GPIO to handle MISO + +config LORA32_MOSI_PIN + int "GPIO to handle MOSI" + depends on LORA32_ENABLED + default 27 + help + GPIO to handle MOSI + +config LORA32_CLK_PIN + int "GPIO to handle CLK" + depends on LORA32_ENABLED + default 5 + help + GPIO to handle CLK diff --git a/main/esp32-lora.c b/main/esp32-lora.c index 0d3fec1..c0f1641 100644 --- a/main/esp32-lora.c +++ b/main/esp32-lora.c @@ -16,9 +16,9 @@ #define READ_REG 0x7F #define WRITE_REG 0x80 -#define PIN_NUM_MISO 19 -#define PIN_NUM_MOSI 27 -#define PIN_NUM_CLK 5 +#define PIN_NUM_MISO CONFIG_LORA32_MISO_PIN +#define PIN_NUM_MOSI CONFIG_LORA32_MOSI_PIN +#define PIN_NUM_CLK CONFIG_LORA32_CLK_PIN #define PA_OUTPUT_RFO_PIN 0 #define PA_OUTPUT_PA_BOOST_PIN 1