aboutsummaryrefslogtreecommitdiff
path: root/hw/thefreeman
diff options
context:
space:
mode:
authorSelene ToyKeeper2024-08-19 13:10:04 -0600
committerSelene ToyKeeper2024-08-19 13:10:04 -0600
commit4c2bbf92194ff5f41a87baa95c5388b325a27d2d (patch)
tree2d2b51fc3ef800e55009bc5f01ef7119d4c32d6e /hw/thefreeman
parentts25-boost: reduced visible PWM, made party strobe less blurry (diff)
parentremoved "Off -> 3H" strobe/mood mode access from Extended Simple UI (diff)
downloadanduril-4c2bbf92194ff5f41a87baa95c5388b325a27d2d.tar.gz
anduril-4c2bbf92194ff5f41a87baa95c5388b325a27d2d.tar.bz2
anduril-4c2bbf92194ff5f41a87baa95c5388b325a27d2d.zip
Merge branch 'trunk' into wurkkos-ts25-boost
# By Selene ToyKeeper (20) and others * trunk: (25 commits) removed "Off -> 3H" strobe/mood mode access from Extended Simple UI include hardware-specific readme files in the release .zip added change log for 2024-04-20 release Forgot to update model count after the last couple additions use low aux for chan-aux level 0 MODELS: added emisar-d3aa make-release.sh should use version-string.sh instead of duplicating code d3aa: fixed voltage calculation to use 0.02V units instead of 0.025V d3aa weak battery test: blink 3x instead of 2x, and omit number readout use smooth steps in lockout mode, if enabled fixed Tactical Mode's strobes when Momentary Mode not enabled increased voltage precision from 0.025V to 0.02V (so 0 to 255 now goes from 0.00V to 5.10V) weak battery detection: use different thresholds for AA and Li-Ion (also, fixed bug where a totally empty li-ion didn't get limited) d3aa: got weak battery detection actually working, and not letting the magic smoke out of updi adapters any more (probably) dammit, got alkaline detection half working and then my flashing adapter died (saving progress here so I can work on a different branch) fixed inaccurate comment (thanks to xikteny for spotting it) d3aa fine-tuning: - new ramp - production style config defaults (simple mode, Hank config) - candle tuning - fixed way-too-fast thermal regulation (might still be a bit fast, but it's a lot better) d3aa: fixed voltage measurement Allow manually running GitHub actions workflows Bugfix: Prevent switching channel modes when in tactical mode ... # Conflicts: # arch/attiny1616.c (fixed)
Diffstat (limited to '')
-rw-r--r--hw/thefreeman/avr32dd20-devkit/hwdef.c6
-rw-r--r--hw/thefreeman/avr32dd20-devkit/hwdef.h4
-rw-r--r--hw/thefreeman/boost-fwaa-mp3432-hdr-dac-rgb/hwdef.h4
3 files changed, 7 insertions, 7 deletions
diff --git a/hw/thefreeman/avr32dd20-devkit/hwdef.c b/hw/thefreeman/avr32dd20-devkit/hwdef.c
index 460082f..5b534d2 100644
--- a/hw/thefreeman/avr32dd20-devkit/hwdef.c
+++ b/hw/thefreeman/avr32dd20-devkit/hwdef.c
@@ -119,13 +119,13 @@ bool gradual_tick_main(uint8_t gt) {
uint8_t voltage_raw2cooked(uint16_t measurement) {
// In : 65535 * BATTLVL / 1.024V
- // Out: uint8_t: Vbat * 40
+ // Out: uint8_t: Vbat * 50
// BATTLVL = Vbat * (100.0/(330+100)) = Vbat / 4.3
- // So, Out = In * 4.3 / 1600
+ // So, Out = In * 4.3 / 1280
// (plus a bit of fudging to fix the slope and offset,
// based on measuring actual hardware)
uint8_t result = (uint32_t)(measurement + (65535 * 4 / 1024))
- * 43 / 16128;
+ * 43 / 12880;
return result;
}
diff --git a/hw/thefreeman/avr32dd20-devkit/hwdef.h b/hw/thefreeman/avr32dd20-devkit/hwdef.h
index 38b508d..5015c24 100644
--- a/hw/thefreeman/avr32dd20-devkit/hwdef.h
+++ b/hw/thefreeman/avr32dd20-devkit/hwdef.h
@@ -109,8 +109,8 @@ enum CHANNEL_MODES {
// AVR datasheet table 3.1 I/O Multiplexing, PA6 ADC0 = AIN26
#define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is regulated
#define ADMUX_VOLTAGE_DIVIDER ADC_MUXPOS_AIN26_gc
-#define DUAL_VOLTAGE_FLOOR (4*21) // for AA/14500 boost drivers, don't indicate low voltage if below this level
-#define DUAL_VOLTAGE_LOW_LOW (4*7) // the lower voltage range's danger zone 0.7 volts (NiMH)
+#define DUAL_VOLTAGE_FLOOR (21*dV) // for AA/14500 boost drivers, don't indicate low voltage if below this level
+#define DUAL_VOLTAGE_LOW_LOW ( 7*dV) // the lower voltage range's danger zone 0.7 volts (NiMH)
// don't use the default VDD converter
// convert BATT LVL pin readings to FSM volt units
#undef voltage_raw2cooked
diff --git a/hw/thefreeman/boost-fwaa-mp3432-hdr-dac-rgb/hwdef.h b/hw/thefreeman/boost-fwaa-mp3432-hdr-dac-rgb/hwdef.h
index bc1d9a7..1c6e6be 100644
--- a/hw/thefreeman/boost-fwaa-mp3432-hdr-dac-rgb/hwdef.h
+++ b/hw/thefreeman/boost-fwaa-mp3432-hdr-dac-rgb/hwdef.h
@@ -94,8 +94,8 @@ enum CHANNEL_MODES {
// Voltage divider battLVL
#define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is regulated
#define ADMUX_VOLTAGE_DIVIDER ADC_MUXPOS_AIN2_gc // which ADC channel to read
-#define DUAL_VOLTAGE_FLOOR (4*21) // for AA/14500 boost drivers, don't indicate low voltage if below this level
-#define DUAL_VOLTAGE_LOW_LOW (4*7) // the lower voltage range's danger zone 0.7 volts (NiMH)
+#define DUAL_VOLTAGE_FLOOR (21*dV) // for AA/14500 boost drivers, don't indicate low voltage if below this level
+#define DUAL_VOLTAGE_LOW_LOW ( 7*dV) // the lower voltage range's danger zone 0.7 volts (NiMH)
// don't use the default VDD converter
#undef voltage_raw2cooked
#define voltage_raw2cooked mcu_vdivider_raw2cooked