From 114843dff21cd241415a7eef22b1943019cb16d5 Mon Sep 17 00:00:00 2001 From: Pirata Date: Thu, 7 Nov 2024 07:46:45 -0300 Subject: [PATCH] T-Embed Battery charging Fix --- platformio.ini | 4 ++-- src/main.cpp | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index 428c464..b15d097 100644 --- a/platformio.ini +++ b/platformio.ini @@ -926,7 +926,7 @@ build_flags = lib_deps = ${common.lib_deps} - https://github.com/lewisxhe/XPowersLib + lewisxhe/XPowersLib @ ^0.2.4 @@ -1190,7 +1190,7 @@ build_flags = lib_deps = ${common.lib_deps} - lewisxhe/XPowersLib @ ^0.2.6 + lewisxhe/XPowersLib @ ^0.2.4 mathertel/RotaryEncoder @ ^1.5.3 diff --git a/src/main.cpp b/src/main.cpp index a2823d0..91a01d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -236,14 +236,8 @@ void setup() { PPM.enableADCMeasure(); PPM.enableCharge(); } - - - // To obtain voltage data, the ADC must be enabled first - PPM.enableADCMeasure(); - - // Turn on charging function - // If there is no battery connected, do not turn on the charging function - PPM.enableCharge(); + PPM.enableOTG(); + PPM.disableOTG(); pinMode(12, OUTPUT); digitalWrite(12,HIGH);//CS pin for CC1101 pin #else