X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?p=bike-lights.git;a=blobdiff_plain;f=firmware%2Flights.h;h=fe8b59f10730c097394cec835b3dbab7206796d1;hp=4a23436ea79dd84b8b21a055c70890cce5127fbe;hb=7f7665a5234d4d5cbd94fed9be55862772f3dc12;hpb=71966b0545b53262ef946c0ae26007664eff32ce diff --git a/firmware/lights.h b/firmware/lights.h index 4a23436..fe8b59f 100644 --- a/firmware/lights.h +++ b/firmware/lights.h @@ -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);