Skip to content

Commit 9bf39fb

Browse files
authored
ADC battery made standard across devices
1 parent 50ba776 commit 9bf39fb

File tree

27 files changed

+35
-114
lines changed

27 files changed

+35
-114
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Things that needs to be done in next updates
8787
* 2.6.5:
8888
* [x] Added possibility to order by "Latest update"
8989
* [x] Port to OpenSourceSRDLabs [WaveSentry and WaveSentry Pro ](https://opensourcesdrlab.com/products/aifw-wavesentry-esp32?VariantsId=10331)
90+
* [x] Battery ADC measurement fix for Cardputer, Tdeck, StickCPlus2, T-Display S3, T-HMI
91+
9092
* 2.6.4:
9193
* [x] Fixed CYD 3243S035R touchscreen rotation
9294
* [x] Fixed Marauder V7 screen issues

boards/CYD-2432S028/custom_flags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def generate_build_flags(board_config):
3030
flags.append("-DUP_BTN=-1")
3131
flags.append("-DDW_BTN=-1")
3232
flags.append("-DBTN_ACT=LOW")
33-
flags.append("-DBAT_PIN=4")
3433
flags.append("-DBTN_ALIAS='\"Sel\"'")
3534
flags.append("-DMINBRIGHT=190")
3635
flags.append("-DBACKLIGHT=21")

boards/ESP-General/interface.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ void _post_setup_gpio() {
1818
pinMode(SEL_BTN, INPUT);
1919
}
2020

21-
/***************************************************************************************
22-
** Function name: getBattery()
23-
** location: display.cpp
24-
** Description: Delivers the battery value from 1-100
25-
***************************************************************************************/
26-
int getBattery() { return 0; }
27-
2821
/*********************************************************************
2922
** Function: setBrightness
3023
** location: settings.cpp

boards/_New-Device-Model/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ build_flags =
3434
-DBTN_ALIAS='"M5"'
3535
-DLED=19
3636
-DLED_ON=HIGH
37-
-DBAT_PIN=38
37+
-DANALOG_BAT_PIN=38
3838
-DBACKLIGHT=27
3939
-DMINBRIGHT=190
4040
-DFP=1

boards/elecrow/platformio.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ build_flags =
2828
-DUP_BTN=-1
2929
-DDW_BTN=-1
3030
-DBTN_ACT=LOW
31-
-DBAT_PIN=4
3231
-DBTN_ALIAS='"Sel"'
3332
-DMINBRIGHT=190
3433
-DBACKLIGHT=27
@@ -87,7 +86,6 @@ build_flags =
8786
-DUP_BTN=-1
8887
-DDW_BTN=-1
8988
-DBTN_ACT=LOW
90-
-DBAT_PIN=4
9189
-DBTN_ALIAS='\"Sel\"'
9290
-DMINBRIGHT=190
9391
-DBACKLIGHT=27

boards/lilygo-t-deck-pro/platformio.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ build_flags =
2929
-DUP_BTN=-1
3030
-DDW_BTN=-1
3131
-DBTN_ACT=LOW
32-
-DBAT_PIN=4
3332
-DBTN_ALIAS='"Sel"'
3433
-DMINBRIGHT=190
3534
-DBACKLIGHT=40

boards/lilygo-t-deck/interface.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,6 @@ void _setup_gpio() {
9595
// uint8_t isPlus = false;
9696
void _post_setup_gpio() {}
9797

98-
/***************************************************************************************
99-
** Function name: getBattery()
100-
** location: display.cpp
101-
** Description: Delivers the battery value from 1-100
102-
***************************************************************************************/
103-
int getBattery() {
104-
uint8_t percent;
105-
uint32_t volt = analogReadMilliVolts(GPIO_NUM_4);
106-
107-
float mv = volt;
108-
percent = (mv - 3300) * 100 / (float)(4150 - 3350);
109-
110-
return (percent < 0) ? 0 : (percent >= 100) ? 100 : percent;
111-
}
112-
11398
/*********************************************************************
11499
** Function: setBrightness
115100
** location: settings.cpp

boards/lilygo-t-deck/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ build_flags =
3737

3838
-DBTN_ACT=LOW
3939
;-DLR_ACT=HIGH
40-
-DBAT_PIN=4
40+
-DANALOG_BAT_PIN=4
4141
-DBTN_ALIAS='"Mid"'
4242
-DMINBRIGHT=1
4343
-DBACKLIGHT=42 ;TFT_BL

boards/lilygo-t-display-s3-amoled/platformio.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ build_flags =
3333
-DUP_BTN=-1
3434
-DDW_BTN=-1
3535
-DBTN_ACT=LOW
36-
-DBAT_PIN=-1
3736
-DBTN_ALIAS='"Sel"'
3837
-DLED=-1
3938
-DLED_ON=HIGH

boards/lilygo-t-display-s3-pro/platformio.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ build_flags =
3333
-DUP_BTN=12
3434
-DDW_BTN=16
3535
-DBTN_ACT=LOW
36-
-DBAT_PIN=4
3736
-DBTN_ALIAS='"Sel"'
3837
-DMINBRIGHT=190
3938
-DBACKLIGHT=TFT_BL

0 commit comments

Comments
 (0)