From aaa760e5243cf87a43297945b20e41a448c906e4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 28 Oct 2023 07:02:38 -0600 Subject: switched blf-lt1-t1616 from plain PWM to PWM+DSM (and made DSM interrupt definitions a bit cleaner) --- hwdef-noctigon-m44.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'hwdef-noctigon-m44.h') diff --git a/hwdef-noctigon-m44.h b/hwdef-noctigon-m44.h index 2a9198a..a41ea79 100644 --- a/hwdef-noctigon-m44.h +++ b/hwdef-noctigon-m44.h @@ -39,8 +39,8 @@ // channel modes: // * 0. channel 1 only // * 1. channel 2 only -// * 2. both channels, tied together -// * 3. both channels, manual blend +// * 2. both channels, tied together, max "200%" power +// * 3. both channels, manual blend, max "100%" power // * 4? both channels, manual blend, max 200% power // * 4. both channels, auto blend, reversible #define NUM_CHANNEL_MODES (5 + NUM_RGB_AUX_CHANNEL_MODES) @@ -65,7 +65,7 @@ enum channel_modes_e { #define PWM_CHANNELS 1 // old, remove this -#define PWM_BITS 16 // 0 to 16383 at variable Hz, not 0 to 255 at 16 kHz +#define PWM_BITS 16 // 0 to 32640 (0 to 255 PWM + 0 to 127 DSM) at constant kHz #define PWM_GET PWM_GET16 #define PWM_DATATYPE uint16_t #define PWM_DATATYPE2 uint32_t // only needs 32-bit if ramp values go over 255 @@ -80,6 +80,11 @@ enum channel_modes_e { // (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM) #define DSM_TOP (255<<7) // 15-bit resolution leaves 1 bit for carry +// timer interrupt for DSM +#define DSM_vect TIMER1_OVF_vect +#define DSM_INTCTRL TIMSK +#define DSM_OVF_bm (1<