Revision f8cf404d components/power/adconverter.cpp
components/power/adconverter.cpp | ||
---|---|---|
116 | 116 |
|
117 | 117 |
if (global.adc1_buffer[0] > uV2Adc(this->watchdog_threshold_uV)) |
118 | 118 |
{ |
119 |
chprintf((BaseSequentialStream*)&SD1, "%f > 9V detected: now charging\n", ((float)adc2uV(global.adc1_buffer[0]))/1000000.0f);
|
|
119 |
chprintf((BaseSequentialStream*)&global.sercanmux1, "%f > 9V detected: now charging\n", ((float)adc2uV(global.adc1_buffer[0]))/1000000.0f);
|
|
120 | 120 |
global.robot.getPowerStatus().charging_flags.content.vsys_higher_than_9V = true; |
121 | 121 |
global.bq24103a[constants::PowerManagement::BAT_P7]->enable(true); |
122 | 122 |
global.bq24103a[constants::PowerManagement::BAT_P8]->enable(true); |
123 | 123 |
this->conversion_group.htr = ADC_HTR_HT; |
124 | 124 |
this->conversion_group.ltr = ADC_LTR(uV2Adc(this->watchdog_threshold_uV)); |
125 | 125 |
} else { |
126 |
chprintf((BaseSequentialStream*)&SD1, "%f < 9V detected: not charging\n", ((float)adc2uV(global.adc1_buffer[0]))/1000000.0f);
|
|
126 |
chprintf((BaseSequentialStream*)&global.sercanmux1, "%f < 9V detected: not charging\n", ((float)adc2uV(global.adc1_buffer[0]))/1000000.0f);
|
|
127 | 127 |
global.robot.getPowerStatus().charging_flags.content.vsys_higher_than_9V = false; |
128 | 128 |
this->conversion_group.htr = ADC_HTR(uV2Adc(this->watchdog_threshold_uV)); |
129 | 129 |
this->conversion_group.ltr = 0; |
Also available in: Unified diff