feat: Jumper T15 support (#5113)

Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
3djc
2024-06-07 17:51:49 +10:00
committed by GitHub
co-authored by 3djc philmoz
parent f6f6d2a85a
commit 26c96ccdd0
83 changed files with 3354 additions and 136 deletions
+46
View File
@@ -65,6 +65,52 @@ void boardInit()
#endif
pwrInit();
#if defined(FUNCTION_SWITCHES) && !defined(DEBUG_SEGGER_RTT)
#if defined(RADIO_T15)
#define LEDCHARGEON(x) fsLedOff(x)
#define LEDCHARGEOFF(x) fsLedOn(x)
#else
#define LEDCHARGEON(x) fsLedOn(x)
#define LEDCHARGEOFF(x) fsLedOff(x)
#endif
// This is needed to prevent radio from starting when usb is plugged to charge
usbInit();
ledInit();
// prime debounce state...
usbPlugged();
if (usbPlugged()) {
delaysInit();
adcInit(&_adc_driver);
getADC();
pwrOn(); // required to get bat adc reads
INTERNAL_MODULE_OFF();
EXTERNAL_MODULE_OFF();
for (uint8_t i=0; i < NUM_FUNCTIONS_SWITCHES; i++)
LEDCHARGEOFF(i);
while (usbPlugged()) {
// Let it charge ...
getADC(); // Warning: the value read does not include VBAT calibration
// Also, MCU is running which create a drop vs off
if (getBatteryVoltage() >= 660)
LEDCHARGEON(0);
if (getBatteryVoltage() >= 700)
LEDCHARGEON(1);
if (getBatteryVoltage() >= 740)
LEDCHARGEON(2);
if (getBatteryVoltage() >= 780)
LEDCHARGEON(3);
if (getBatteryVoltage() >= 810)
LEDCHARGEON(4);
if (getBatteryVoltage() >= 820)
LEDCHARGEON(5);
delay_ms(1000);
}
while(1) // Wait power to drain
pwrOff();
}
#endif
boardInitModulePorts();
#if defined(INTMODULE_HEARTBEAT) && \