diff options
| author | Selene ToyKeeper | 2023-11-27 09:00:32 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-11-27 09:00:32 -0700 |
| commit | c86ab86da7763e4d88c2c6865f916873af02742d (patch) | |
| tree | 187f5bd7efe0c9f208a440d660391c4b7dbced2e /hw | |
| parent | fixed ADC on attiny85 and related builds (diff) | |
| download | anduril-c86ab86da7763e4d88c2c6865f916873af02742d.tar.gz anduril-c86ab86da7763e4d88c2c6865f916873af02742d.tar.bz2 anduril-c86ab86da7763e4d88c2c6865f916873af02742d.zip | |
fixed ADC on sp10-pro
Diffstat (limited to '')
| -rw-r--r-- | hw/sofirn/sp10-pro/hwdef.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/sofirn/sp10-pro/hwdef.h b/hw/sofirn/sp10-pro/hwdef.h index 047758b..f220318 100644 --- a/hw/sofirn/sp10-pro/hwdef.h +++ b/hw/sofirn/sp10-pro/hwdef.h @@ -66,16 +66,19 @@ enum CHANNEL_MODES { #define DUAL_VOLTAGE_LOW_LOW (4*7) // the lower voltage range's danger zone 0.7 volts (NiMH) #define ADMUX_VOLTAGE_DIVIDER ADC_MUXPOS_AIN9_gc // which ADC channel to read +#undef voltage_raw2cooked +#define voltage_raw2cooked mcu_vdivider_raw2cooked + // Raw ADC readings at 4.4V and 2.2V // calibrate the voltage readout here // estimated / calculated values are: // (voltage - D1) * (R2/(R2+R1) * 1024 / 1.1) // Resistors are 300,000 and 100,000 #ifndef ADC_44 -#define ADC_44 1023 // raw value at 4.40V +#define ADC_44 (4*1023) // raw value at 4.40V #endif #ifndef ADC_22 -#define ADC_22 512 // raw value at 2.20V +#define ADC_22 (4*512) // raw value at 2.20V #endif |
