️ Refactor still needs work

Reverting #23295
This commit is contained in:
Scott Lahteine
2021-12-25 23:15:17 -06:00
parent 00e6e90648
commit 6a8b9274a3
69 changed files with 1301 additions and 1771 deletions

View File

@@ -35,9 +35,10 @@ struct Timer {
};
/**
* Get the timer information and register for a pin.
* Return a Timer struct containing this information.
* Used by set_pwm_frequency, set_pwm_duty
* get_pwm_timer
* Get the timer information and register of the provided pin.
* Return a Timer struct containing this information.
* Used by set_pwm_frequency, set_pwm_duty
*/
Timer get_pwm_timer(const pin_t pin) {
uint8_t q = 0;
@@ -149,7 +150,7 @@ Timer get_pwm_timer(const pin_t pin) {
return timer;
}
void MarlinHAL::set_pwm_frequency(const pin_t pin, int f_desired) {
void set_pwm_frequency(const pin_t pin, int f_desired) {
Timer timer = get_pwm_timer(pin);
if (timer.n == 0) return; // Don't proceed if protected timer or not recognized
uint16_t size;
@@ -229,7 +230,7 @@ void MarlinHAL::set_pwm_frequency(const pin_t pin, int f_desired) {
#endif // NEEDS_HARDWARE_PWM
void MarlinHAL::set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
#if NEEDS_HARDWARE_PWM
// If v is 0 or v_size (max), digitalWrite to LOW or HIGH.