diff options
| author | Selene ToyKeeper | 2023-11-27 08:47:37 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-11-27 08:47:37 -0700 |
| commit | 37feeae1ac48ae9b70c99b768943648fd6c354ff (patch) | |
| tree | cca4e711dc234d33233006afb85b82547cd0f04b /hw/mateminco/mf01s | |
| parent | fixed ADC on attiny1634 and related builds (diff) | |
| download | anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.tar.gz anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.tar.bz2 anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.zip | |
fixed ADC on attiny85 and related builds
(also enabled smooth steps on BLF GT, but had to remove stuff to make room)
Diffstat (limited to 'hw/mateminco/mf01s')
| -rw-r--r-- | hw/mateminco/mf01s/hwdef.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/mateminco/mf01s/hwdef.h b/hw/mateminco/mf01s/hwdef.h index fef5050..21ea1fd 100644 --- a/hw/mateminco/mf01s/hwdef.h +++ b/hw/mateminco/mf01s/hwdef.h @@ -67,14 +67,18 @@ enum CHANNEL_MODES { // 1.1V reference, no left-adjust, ADC1/PB2 #define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL) #endif + +#undef voltage_raw2cooked +#define voltage_raw2cooked mcu_vdivider_raw2cooked + #define ADC_PRSCL 0x07 // clk/128 // Raw ADC readings at 4.4V and 2.2V (in-between, we assume values form a straight line) #ifndef ADC_44 -#define ADC_44 (234*4) +#define ADC_44 (234*4*4) #endif #ifndef ADC_22 -#define ADC_22 (117*4) +#define ADC_22 (117*4*4) #endif #define FAST 0xA3 // fast PWM both channels |
