aboutsummaryrefslogtreecommitdiff
path: root/hwdef-Sofirn_SP10-Pro.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-11-13 05:35:01 -0700
committerSelene ToyKeeper2021-11-13 05:35:01 -0700
commit396fc623c7dce04fcd0a9afc9e777bb06b766a34 (patch)
treedda15e5ec9b29449412c9cc03471ba5736bacef4 /hwdef-Sofirn_SP10-Pro.h
parentenabled manual memory and timer by default; (diff)
downloadanduril-396fc623c7dce04fcd0a9afc9e777bb06b766a34.tar.gz
anduril-396fc623c7dce04fcd0a9afc9e777bb06b766a34.tar.bz2
anduril-396fc623c7dce04fcd0a9afc9e777bb06b766a34.zip
fixed SP10 ramp flickering properly, using double-buffered registers
instead of my janky forced phase-reset workaround (gchart found the solution but couldn't reproduce the issue, so I tried his method and confirmed it seems to be fixed)
Diffstat (limited to 'hwdef-Sofirn_SP10-Pro.h')
-rw-r--r--hwdef-Sofirn_SP10-Pro.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/hwdef-Sofirn_SP10-Pro.h b/hwdef-Sofirn_SP10-Pro.h
index 3cd405c..bb10f2f 100644
--- a/hwdef-Sofirn_SP10-Pro.h
+++ b/hwdef-Sofirn_SP10-Pro.h
@@ -37,18 +37,19 @@ PA1 : Boost Enable
// Small channel
#ifndef PWM1_PIN
#define PWM1_PIN PB5
-#define PWM1_LVL TCA0.SINGLE.CMP2 // PB5 is Alternate MUX for TCA Compare 2
-#define PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment
+#define PWM1_LVL TCA0.SINGLE.CMP2BUF // PB5 is Alternate MUX for TCA Compare 2
#endif
// Big channel
#ifndef PWM2_PIN
#define PWM2_PIN PB0
-#define PWM2_LVL TCA0.SINGLE.CMP0 // PB0 is TCA Compare 0
+#define PWM2_LVL TCA0.SINGLE.CMP0BUF // PB0 is TCA Compare 0
#endif
// PWM parameters of both channels are tied together because they share a counter
-#define PWM1_TOP TCA0.SINGLE.PER // holds the TOP value for for variable-resolution PWM
+#define PWM1_TOP TCA0.SINGLE.PERBUF // holds the TOP value for for variable-resolution PWM
+// not necessary when double-buffered "BUF" registers are used
+//#define PWM1_CNT TCA0.SINGLE.CNT // for resetting phase after each TOP adjustment
#define LED_ENABLE_PIN PIN1_bp
#define LED_ENABLE_PORT PORTA_OUT