]> www.fi.muni.cz Git - bike-lights.git/blobdiff - firmware/lights.h
pwm.c: publish only PWM_MAX as non-internal value
[bike-lights.git] / firmware / lights.h
index 4a23436ea79dd84b8b21a055c70890cce5127fbe..fe8b59f10730c097394cec835b3dbab7206796d1 100644 (file)
@@ -27,11 +27,12 @@ void init_adc();
 void susp_adc();
 
 /* pwm.c */
-#define PWM_MAX 0x1E4 /* This should be different than ADC frequency 125 kHz */
-#define PWM_STEP_SHIFT 2 /* second parameter of pwm_set is shifted by
-                         * PWM_STEP_SHIFT bits to the right before setting
-                         * into HW */
-
+/*
+ * The real Timer/Counter 1 frequency should not be too close to the
+ * A/D converter frequency (125 kHz). Note that this is not the Top
+ * value of T/C 1, it is shifted by PWM_STEP_SHIFT as described in pwm.c
+ */
+#define PWM_MAX 0x780
 void init_pwm();
 void susp_pwm();
 void pwm_off(unsigned char n);