Bsongis/x9lite pwr fix (#6501)

X9 Pwr fix
This commit is contained in:
Bertrand Songis
2019-06-14 21:19:26 +02:00
committed by GitHub
parent 7c3ad50e7d
commit c3388dc65e
24 changed files with 306 additions and 353 deletions
-10
View File
@@ -498,16 +498,6 @@ void calcConsumption()
}
}
void checkTrainerSettings()
{
if (SLAVE_MODE()) {
PIOC->PIO_PDR = PIO_PC22;
}
else {
PIOC->PIO_PER = PIO_PC22;
}
}
uint16_t getBatteryVoltage()
{
int32_t instant_vbat = anaIn(TX_VOLTAGE); // using filtered ADC value on purpose
+1 -2
View File
@@ -34,7 +34,6 @@ extern uint16_t ResetReason;
#define FIRMWARE_ADDRESS 0x00400000
// Board driver
void boardPreInit(void);
void boardInit(void);
#define boardOff() pwrOff()
@@ -212,8 +211,8 @@ void calcConsumption();
// Trainer driver
#define SLAVE_MODE() (pwrCheck() == e_power_trainer)
#define TRAINER_CONNECTED() (PIOA->PIO_PDSR & PIO_PA8)
void checkTrainerSettings();
void init_trainer_capture();
void stop_trainer_capture();
// Write Flash driver
#define FLASH_PAGESIZE 256
+2 -2
View File
@@ -82,14 +82,14 @@ extern "C" void TC3_IRQHandler() //capture ppm in at 2MHz
void init_trainer_capture()
{
PIOC->PIO_PER = PIO_PC22;
start_timer4() ;
start_timer3() ;
}
#if 0
void stop_trainer_capture()
{
PIOC->PIO_PDR = PIO_PC22;
TC1->TC_CHANNEL[0].TC_IDR = TC_IDR0_LDRAS ;
NVIC_DisableIRQ(TC3_IRQn) ;
}
#endif