aboutsummaryrefslogtreecommitdiff
path: root/hw/lumintop/blf-gt
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-27 08:47:37 -0700
committerSelene ToyKeeper2023-11-27 08:47:37 -0700
commit37feeae1ac48ae9b70c99b768943648fd6c354ff (patch)
treecca4e711dc234d33233006afb85b82547cd0f04b /hw/lumintop/blf-gt
parentfixed ADC on attiny1634 and related builds (diff)
downloadanduril-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/lumintop/blf-gt')
-rw-r--r--hw/lumintop/blf-gt/anduril.h7
-rw-r--r--hw/lumintop/blf-gt/hwdef.h8
2 files changed, 13 insertions, 2 deletions
diff --git a/hw/lumintop/blf-gt/anduril.h b/hw/lumintop/blf-gt/anduril.h
index 2fc359e..cc2f940 100644
--- a/hw/lumintop/blf-gt/anduril.h
+++ b/hw/lumintop/blf-gt/anduril.h
@@ -54,7 +54,14 @@
#undef BLINK_AT_RAMP_MIDDLE
#undef BLINK_AT_RAMP_FLOOR
+#define USE_SMOOTH_STEPS
+
// too big, turn off extra features
//#undef USE_TACTICAL_MODE
#undef USE_SOS_MODE
+#undef USE_BEACON_MODE
+#undef USE_RAMP_AFTER_MOON_CONFIG
+//#undef USE_RAMP_SPEED_CONFIG
+//#undef USE_VOLTAGE_CORRECTION
+#undef USE_2C_STYLE_CONFIG
diff --git a/hw/lumintop/blf-gt/hwdef.h b/hw/lumintop/blf-gt/hwdef.h
index dbaf18e..68197ac 100644
--- a/hw/lumintop/blf-gt/hwdef.h
+++ b/hw/lumintop/blf-gt/hwdef.h
@@ -67,14 +67,18 @@ enum CHANNEL_MODES {
//#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | (1 << ADLAR) | VOLTAGE_CHANNEL)
// 1.1V reference, no left-adjust, ADC1/PB2
#define ADMUX_VOLTAGE_DIVIDER ((1 << V_REF) | VOLTAGE_CHANNEL)
+
+#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 (184*4)
+#define ADC_44 (184*4*4)
#endif
#ifndef ADC_22
-#define ADC_22 (92*4)
+#define ADC_22 (92*4*4)
#endif
#define FAST 0xA3 // fast PWM both channels
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.