aboutsummaryrefslogtreecommitdiff
path: root/hwdef-Emisar_D4Sv2-tintramp.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-11-12 03:15:21 -0700
committerSelene ToyKeeper2021-11-12 03:15:21 -0700
commit4873134411e7309c951478c2c3739bdd4b3ff9fb (patch)
tree3c24418836fdafe140c05e16735dc03964cb7ce4 /hwdef-Emisar_D4Sv2-tintramp.h
parentfine-tuned DM11-12V build a bit based on actual measurements (diff)
parentfixed KR4-tintramp build (switch wasn't working) and added it to MODELS (diff)
downloadanduril-4873134411e7309c951478c2c3739bdd4b3ff9fb.tar.gz
anduril-4873134411e7309c951478c2c3739bdd4b3ff9fb.tar.bz2
anduril-4873134411e7309c951478c2c3739bdd4b3ff9fb.zip
merged anduril2 branch for updates
Diffstat (limited to 'hwdef-Emisar_D4Sv2-tintramp.h')
-rw-r--r--hwdef-Emisar_D4Sv2-tintramp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/hwdef-Emisar_D4Sv2-tintramp.h b/hwdef-Emisar_D4Sv2-tintramp.h
index 76f6097..90545f4 100644
--- a/hwdef-Emisar_D4Sv2-tintramp.h
+++ b/hwdef-Emisar_D4Sv2-tintramp.h
@@ -47,12 +47,15 @@
#define USE_DYN_PWM // dynamic frequency and speed
#define PWM_DATATYPE2 uint32_t // only needs 32-bit if ramp values go over 255
+#ifndef SWITCH_PIN
#define SWITCH_PIN PA7 // pin 20
#define SWITCH_PCINT PCINT7 // pin 20 pin change interrupt
#define SWITCH_PCIE PCIE0 // PCIE1 is for PCINT[7:0]
#define SWITCH_PCMSK PCMSK0 // PCMSK1 is for PCINT[7:0]
#define SWITCH_PORT PINA // PINA or PINB or PINC
+#define SWITCH_PUE PUEA // pullup group A
#define PCINT_vect PCINT0_vect // ISR for PCINT[7:0]
+#endif
// usually PWM1_LVL would be a hardware register, but we need to abstract
// it out to a soft brightness value, in order to handle tint ramping
@@ -173,7 +176,7 @@ inline void hwdef_setup() {
PWM1_TOP = PWM_TOP;
// set up e-switch
- PUEA = (1 << SWITCH_PIN); // pull-up for e-switch
+ SWITCH_PUE = (1 << SWITCH_PIN); // pull-up for e-switch
SWITCH_PCMSK = (1 << SWITCH_PCINT); // enable pin change interrupt
}