From a1514b8b64f037eeee8984bd6e9287e4b27bdb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 18 Sep 2023 11:38:33 +0200 Subject: [PATCH] Enable (new) ADC and GPS capability. (#2792) * Enable (new) ADC and GPS capability. * Make Picomputer a canon device and define ADC for new board revision --- variants/picomputer-s3/platformio.ini | 2 +- variants/picomputer-s3/variant.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/variants/picomputer-s3/platformio.ini b/variants/picomputer-s3/platformio.ini index e7093697a..202cd05e7 100644 --- a/variants/picomputer-s3/platformio.ini +++ b/variants/picomputer-s3/platformio.ini @@ -1,7 +1,7 @@ [env:picomputer-s3] extends = esp32s3_base board = bpi_picow_esp32_s3 -board_level = extra + ;OpenOCD flash method ;upload_protocol = esp-builtin ;Normal method diff --git a/variants/picomputer-s3/variant.h b/variants/picomputer-s3/variant.h index 716f2779d..732be4bcf 100644 --- a/variants/picomputer-s3/variant.h +++ b/variants/picomputer-s3/variant.h @@ -5,9 +5,14 @@ #define PIN_BUZZER 43 -#define HAS_GPS 0 #define HAS_WIRE 0 +#define BATTERY_PIN ADC1_CHANNEL_1_GPIO_NUM // 2 +// A battery voltage measurement pin, voltage divider connected here to measure battery voltage +// ratio of voltage divider = 3.0 (R11=200k, R7=100k) +#define ADC_MULTIPLIER 3.1 // 3.0 with correction of display undervoltage. +#define ADC_CHANNEL ADC1_GPIO2_CHANNEL + #define USE_RF95 // RFM95/SX127x #define RF95_SCK SCK // 21