mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-24 22:05:58 +08:00
*** empty log message ***
This commit is contained in:
@@ -60,16 +60,15 @@
|
||||
#endif
|
||||
|
||||
/* battery on AD1.7 */
|
||||
#define ADC_BAT AdcBank1(7)
|
||||
#ifdef USE_ADC_BAT
|
||||
#define ADC_CHANNEL_VSUPPLY AdcBank1(7)
|
||||
#ifndef USE_AD1
|
||||
#define USE_AD1
|
||||
#endif
|
||||
#define USE_AD1_7
|
||||
|
||||
#ifndef VoltageOfAdc
|
||||
#define VoltageOfAdc(adc) (0.004295*adc)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* CONFIG_BOOZ_H */
|
||||
|
||||
@@ -8,9 +8,9 @@ uint8_t booz_energy_bat;
|
||||
static struct adc_buf bat_adc_buf;
|
||||
|
||||
void booz_energy_init( void ) {
|
||||
adc_buf_channel(ADC_BAT, &bat_adc_buf, DEFAULT_AV_NB_SAMPLE);
|
||||
adc_buf_channel(ADC_CHANNEL_VSUPPLY, &bat_adc_buf, DEFAULT_AV_NB_SAMPLE);
|
||||
}
|
||||
|
||||
void booz_energy_periodic( void ) {
|
||||
booz_energy_bat = bat_adc_buf.sum * 0.004295;
|
||||
booz_energy_bat = VoltageOfAdc(bat_adc_buf.sum);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user