aboutsummaryrefslogtreecommitdiff
path: root/hw/hank/emisar-d3aa/hwdef.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2024-03-25 04:25:43 -0600
committerSelene ToyKeeper2024-03-25 04:25:43 -0600
commita87812f436e08b14a7cede83e30306d779774872 (patch)
tree42ea09d981ade4d582a01f9c03dc996dc0d3f57b /hw/hank/emisar-d3aa/hwdef.h
parentd3aa fine-tuning: (diff)
downloadanduril-a87812f436e08b14a7cede83e30306d779774872.tar.gz
anduril-a87812f436e08b14a7cede83e30306d779774872.tar.bz2
anduril-a87812f436e08b14a7cede83e30306d779774872.zip
dammit, got alkaline detection half working and then my flashing adapter died
(saving progress here so I can work on a different branch)
Diffstat (limited to 'hw/hank/emisar-d3aa/hwdef.h')
-rw-r--r--hw/hank/emisar-d3aa/hwdef.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/hank/emisar-d3aa/hwdef.h b/hw/hank/emisar-d3aa/hwdef.h
index 56dd061..1e677b6 100644
--- a/hw/hank/emisar-d3aa/hwdef.h
+++ b/hw/hank/emisar-d3aa/hwdef.h
@@ -114,6 +114,15 @@ enum CHANNEL_MODES {
#define USE_VOLTAGE_VDDIO2
#endif
+// Alkaline AA can't handle the power this light wants,
+// so try to detect it and limit the maximum power
+#define USE_RAMP_LEVEL_HARD_LIMIT
+#define USE_WEAK_BATTERY_PROTECTION
+#define WEAK_BATTERY_HIGHEST_LIMIT RAMP_SIZE
+#define WEAK_BATTERY_MEDIUM_LIMIT (RAMP_SIZE*2/3)
+#define WEAK_BATTERY_LOWEST_LIMIT (RAMP_SIZE*1/3)
+#define WEAK_BATTERY_CHECK_LEVEL (RAMP_SIZE*2/3)
+
// average drop across diode on this hardware
#ifndef VOLTAGE_FUDGE_FACTOR
#define VOLTAGE_FUDGE_FACTOR 0 // using a PFET so no appreciable drop