aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hwdef-emisar-d4v2.c2
-rw-r--r--hwdef-emisar-d4v2.h12
-rw-r--r--hwdef-noctigon-kr4.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/hwdef-emisar-d4v2.c b/hwdef-emisar-d4v2.c
index 9b647a3..db32f19 100644
--- a/hwdef-emisar-d4v2.c
+++ b/hwdef-emisar-d4v2.c
@@ -19,7 +19,7 @@ void set_level_main(uint8_t level) {
PWM_DATATYPE ch1_pwm = PWM_GET(pwm1_levels, level);
PWM_DATATYPE ch2_pwm = PWM_GET(pwm2_levels, level);
// pulse frequency modulation, a.k.a. dynamic PWM
- uint16_t top = PWM_GET(pwm_tops, level);
+ uint16_t top = PWM_GET16(pwm_tops, level);
CH1_PWM = ch1_pwm;
CH2_PWM = ch2_pwm;
diff --git a/hwdef-emisar-d4v2.h b/hwdef-emisar-d4v2.h
index aeb5b0d..e9ffe11 100644
--- a/hwdef-emisar-d4v2.h
+++ b/hwdef-emisar-d4v2.h
@@ -69,12 +69,12 @@
#define PWM_CHANNELS 2 // old, remove this
-#define PWM_BITS 16 // 0 to 16383 at variable Hz, not 0 to 255 at 16 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
-#define PWM1_DATATYPE uint16_t // linear ramp
-#define PWM2_DATATYPE uint16_t // DD FET ramp
+#define PWM_BITS 16 // dynamic 16-bit, but never goes over 255
+#define PWM_GET PWM_GET8
+#define PWM_DATATYPE uint16_t // is used for PWM_TOPS (which goes way over 255)
+#define PWM_DATATYPE2 uint16_t // only needs 32-bit if ramp values go over 255
+#define PWM1_DATATYPE uint8_t // linear ramp
+#define PWM2_DATATYPE uint8_t // DD FET ramp
// PWM parameters of both channels are tied together because they share a counter
#define PWM_TOP ICR1 // holds the TOP value for for variable-resolution PWM
diff --git a/hwdef-noctigon-kr4.h b/hwdef-noctigon-kr4.h
index 2e19ba4..b20effc 100644
--- a/hwdef-noctigon-kr4.h
+++ b/hwdef-noctigon-kr4.h
@@ -77,7 +77,7 @@
#define PWM_BITS 16 // dynamic 16-bit, but never goes over 255
#define PWM_GET PWM_GET8
-#define PWM_DATATYPE uint16_t // is used for PWM_TOPS
+#define PWM_DATATYPE uint16_t // is used for PWM_TOPS (which goes way over 255)
#define PWM_DATATYPE2 uint16_t // only needs 32-bit if ramp values go over 255
#define PWM1_DATATYPE uint8_t // linear ramp
#define PWM2_DATATYPE uint8_t // DD FET ramp
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.