🐛 Fix, improve PWM on AVR (#23463)
This commit is contained in:
@@ -207,6 +207,7 @@ inline void HAL_adc_init() {
|
||||
#define strtof strtod
|
||||
|
||||
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
|
||||
#define PWM_FREQUENCY 1000 // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency()
|
||||
|
||||
/**
|
||||
* set_pwm_frequency
|
||||
@@ -226,3 +227,9 @@ void set_pwm_frequency(const pin_t pin, const uint16_t f_desired);
|
||||
* Optionally allows changing the maximum size of the provided value to enable finer PWM duty control [default = 255]
|
||||
*/
|
||||
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size=255, const bool invert=false);
|
||||
|
||||
/*
|
||||
* init_pwm_timers
|
||||
* sets the default frequency for timers 2-5 to 1000HZ
|
||||
*/
|
||||
void init_pwm_timers();
|
||||
|
||||
Reference in New Issue
Block a user