aboutsummaryrefslogtreecommitdiff
path: root/fsm
diff options
context:
space:
mode:
authorSelene ToyKeeper2025-06-04 00:55:40 -0600
committerSelene ToyKeeper2025-06-04 00:55:40 -0600
commitc8a29a67f286d1d9d84ab000697b5727676b8784 (patch)
treec6f1c9758e6ebaf920fd8b6b4c9edf66769e3c41 /fsm
parentts25-boost: calibrated for new prototype (diff)
parentlockout mode now only does momentary moon/low on 1st and 2nd presses, (diff)
downloadanduril-c8a29a67f286d1d9d84ab000697b5727676b8784.tar.gz
anduril-c8a29a67f286d1d9d84ab000697b5727676b8784.tar.bz2
anduril-c8a29a67f286d1d9d84ab000697b5727676b8784.zip
Merge branch 'trunk' into wurkkos-ts25-boost
* trunk: lockout mode now only does momentary moon/low on 1st and 2nd presses, so it no longer flashes on each click while advancing to other functions emisar-d3aa: reduced preflash by changing timing of power enable steps fix "Error: Missing download info for actions/upload-artifact@v3" fixed model number of hank-lume-x1 in MODELS Added changelogs for 2025-04-29 release. memester egg (was written a long time ago on a whim and never committed, may as well do it now) changed hank-lume-x1 model number back on 2024-09-28 for some reason, and didn't commit... saving now to change branches, but should delete this commit if it turns out there was no reason for it hank-lume-x1: minor calibration and cleaning - calibrated party strobe - removed duplicate or commented-out code - added a basic readme hank-lume-x1 cleanup and calibration, part 1: - changed model number from 0281 to 0171 - cleaned up blink_negative and AUXLED_RGB_DIFFERENT_PORTS a little (but the latter needs a complete refactor, as soon as the hardware abstraction code can handle aux LEDs better) - cleaned up USE_LONG_BLINK_FOR_NEGATIVE_SIGN a little - removed USE_OTG_IN_MOMENTARY since it's not actually used - moved hw/loneoceans/lume-x1-avr32dd20/* files into hw/hank/lume-x1/ - superficial cleanup on hank/lume-x1/hwdef.* - removed some of the extra stuff from hank/lume-x1/anduril.h - adjusted calibration (especially ramp table) on hank-lume-x1 (ramp shape is pretty close to a D4K-boost now, but with more firefly modes) (calibration is based on a sample size of 1, further testing needed) cherry-picked hank-lume-x1 code from https://github.com/loneoceans/anduril/commit/d83ebb75dab8c462b7efa841bccc00a136ff15a2 merged SammysHP's fix for TS10 lower-Vf LEDs, reverted my fix (they are now two separate build targets) wurkkos-ts10-rgbaux: limit max power to 200/255, at Wurkkos's request (because otherwise the light destroys its own LEDs at full power) Add Wurkkos TS10 RGB with reduced FET output
Diffstat (limited to '')
-rw-r--r--fsm/misc.c58
-rw-r--r--fsm/misc.h3
2 files changed, 60 insertions, 1 deletions
diff --git a/fsm/misc.c b/fsm/misc.c
index fa8ddd7..915dbd4 100644
--- a/fsm/misc.c
+++ b/fsm/misc.c
@@ -65,6 +65,16 @@ uint8_t blink_digit(uint8_t num) {
return nice_delay_ms(BLINK_SPEED * 8 / 12);
}
+#ifdef USE_LONG_BLINK_FOR_NEGATIVE_SIGN
+void blink_negative() {
+ // "negative" symbol gets a single long blink
+ uint8_t ontime = BLINK_SPEED * 2 / 12;
+ set_level(BLINK_BRIGHTNESS);
+ nice_delay_ms(ontime * 3);
+ set_level(0);
+ nice_delay_ms(ontime * 5);
+}
+#endif
#endif
#ifdef USE_BLINK_BIG_NUM
@@ -245,6 +255,50 @@ void rgb_led_set(uint8_t value) {
// FIXME: move this logic to arch/*
#if (MCU==0x1616) || (MCU==0x32dd20) // ATTINY816, 817, etc
+ // FIXME: this *really* needs to be moved to somewhere hardware-specific
+ #ifdef AUXLED_RGB_DIFFERENT_PORTS
+
+ case 0: // LED off
+ if (i == 0) {
+ AUXLED_R_PORT.DIRSET = (1 << pin);
+ AUXLED_R_PORT.OUTCLR = (1 << pin);
+ } else if (i == 1) {
+ AUXLED_G_PORT.DIRSET = (1 << pin);
+ AUXLED_G_PORT.OUTCLR = (1 << pin);
+ } else if (i == 2) {
+ AUXLED_B_PORT.DIRSET = (1 << pin);
+ AUXLED_B_PORT.OUTCLR = (1 << pin);
+ }
+ break;
+
+ case 1: // LED low
+ if (i == 0) {
+ AUXLED_R_PORT.DIRCLR = (1 << pin);
+ *((uint8_t *)&AUXLED_R_PORT + 0x10 + pin) = PORT_PULLUPEN_bm;
+ } else if (i == 1) {
+ AUXLED_G_PORT.DIRCLR = (1 << pin);
+ *((uint8_t *)&AUXLED_G_PORT + 0x10 + pin) = PORT_PULLUPEN_bm;
+ } else if (i == 2) {
+ AUXLED_B_PORT.DIRCLR = (1 << pin);
+ *((uint8_t *)&AUXLED_B_PORT + 0x10 + pin) = PORT_PULLUPEN_bm;
+ }
+ break;
+
+ default: // LED high
+ if (i==0) {
+ AUXLED_R_PORT.DIRSET = (1 << pin);
+ AUXLED_R_PORT.OUTSET = (1 << pin);
+ } else if (i==1) {
+ AUXLED_G_PORT.DIRSET = (1 << pin);
+ AUXLED_G_PORT.OUTSET = (1 << pin);
+ } else if (i==2) {
+ AUXLED_B_PORT.DIRSET = (1 << pin);
+ AUXLED_B_PORT.OUTSET = (1 << pin);
+ }
+ break;
+
+ #else // not ifdef AUXLED_RGB_DIFFERENT_PORTS
+
case 0: // LED off
AUXLED_RGB_PORT.DIRSET = (1 << pin); // set as output
AUXLED_RGB_PORT.OUTCLR = (1 << pin); // set output low
@@ -258,8 +312,10 @@ void rgb_led_set(uint8_t value) {
AUXLED_RGB_PORT.DIRSET = (1 << pin); // set as output
AUXLED_RGB_PORT.OUTSET = (1 << pin); // set as high
break;
+
+ #endif
- #else
+ #else // not #if (MCU==0x1616) || (MCU==0x32dd20)
case 0: // LED off
AUXLED_RGB_DDR &= 0xff ^ (1 << pin);
diff --git a/fsm/misc.h b/fsm/misc.h
index ba1f8d9..0b13496 100644
--- a/fsm/misc.h
+++ b/fsm/misc.h
@@ -28,6 +28,9 @@ void auto_clock_speed();
#ifdef USE_BLINK_NUM
//#define USE_BLINK
uint8_t blink_num(uint8_t num);
+#ifdef USE_LONG_BLINK_FOR_NEGATIVE_SIGN
+void blink_negative();
+#endif
#endif
/*
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.