From f43bf5f0037df333b281a1f115db147994dd0352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 25 Nov 2025 23:15:36 +0100 Subject: [PATCH] oops --- .../nrf52840/ELECROW-ThinkNode-M4/variant.h | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/variants/nrf52840/ELECROW-ThinkNode-M4/variant.h b/variants/nrf52840/ELECROW-ThinkNode-M4/variant.h index 80b091996..10fc8b360 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M4/variant.h +++ b/variants/nrf52840/ELECROW-ThinkNode-M4/variant.h @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _VARIANT_ELECROW_THINKNODE_M6_ -#define _VARIANT_ELECROW_THINKNODE_M6_ +#ifndef _VARIANT_ELECROW_THINKNODE_M4_ +#define _VARIANT_ELECROW_THINKNODE_M4_ /** Master clock frequency */ #define VARIANT_MCK (64000000ul) @@ -47,22 +47,25 @@ extern "C" { #define LED_STATE_ON 1 -// USB power detection -// #define EXT_PWR_DETECT (13) +// USB / power detection +#define EXT_PWR_DETECT (32 + 3) // P1.03 USB present sense // Button #define PIN_BUTTON1 (4) // Battery ADC -// #define PIN_A0 (28) -// #define BATTERY_PIN PIN_A0 -// #define ADC_CTRL (11) -// #define ADC_CTRL_ENABLED 1 +#define PIN_A0 (2) +#define BATTERY_PIN PIN_A0 +#define BATTERY_SENSE_SAMPLES 30 +#define ADC_RESOLUTION 14 +#define BATTERY_SENSE_RESOLUTION_BITS 12 +#define BATTERY_SENSE_RESOLUTION 4096.0 +#define ADC_MULTIPLIER (2.00F) +#undef AREF_VOLTAGE +#define AREF_VOLTAGE 3.0 +#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 -// static const uint8_t A0 = PIN_A0; - -// #define ADC_RESOLUTION 14 -// #define BATTERY_SENSE_SAMPLES 30 +static const uint8_t A0 = PIN_A0; #define PIN_NFC1 (9) #define PIN_NFC2 (10) @@ -86,8 +89,8 @@ extern "C" { #define PIN_SPI_SCK (6) #define LORA_RESET (32 + 8) -#define LORA_DIO1 (12) // P1.01 // IRQ -#define LORA_DIO2 (26) // P0.07 // BUSY +#define LORA_DIO1 (12) +#define LORA_DIO2 (26) #define LORA_SCK PIN_SPI_SCK #define LORA_MISO PIN_SPI_MISO #define LORA_MOSI PIN_SPI_MOSI @@ -110,27 +113,20 @@ extern "C" { #define VEXT_ON_VALUE LOW // GPS L76K +#define HAS_GPS 1 #define GPS_L76K #define GPS_BAUDRATE 9600 #define PIN_GPS_EN (32 + 11) #define GPS_EN_ACTIVE 0 #define PIN_GPS_REINIT (3) #define PIN_GPS_STANDBY (28) -#define GPS_TX_PIN (32 + 14) -#define GPS_RX_PIN (32 + 12) +#define GPS_TX_PIN (32 + 12) +#define GPS_RX_PIN (32 + 14) #define GPS_THREAD_INTERVAL 50 #define PIN_SERIAL1_RX GPS_TX_PIN #define PIN_SERIAL1_TX GPS_RX_PIN -// Battery -#define BATTERY_SENSE_RESOLUTION_BITS 12 -#define BATTERY_SENSE_RESOLUTION 4096.0 -#undef AREF_VOLTAGE -#define AREF_VOLTAGE 3.0 -#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 -#define ADC_MULTIPLIER (1.75F) - #ifdef __cplusplus } #endif