Esp32 HAL - fixed i2s stream, added PWM to extended pins #14592
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes I2S Stream in ESP32 HAL. Last code didn't fill up the DMA buffer completely, leaving last ~4 samples from older calculation when no more steps were needed. This could result in permanent motor drift if a step was in the last 4 samples.
To direct access the last 16bit of the extension bypassing the DMA a new define I2S_STEPPER_SPLIT_STREAM was introduced for using in pins.h
To handle the extended pins as PWM - a timer inside the HAL adds PWM features - as current Marlin doesn't handle CONTROLLER_FAN, E?_AUTO_FAN by FAN_SOFT_PWM
This also resolves conflicting hardware usage for PWM and servos.
Benefits
Working Stepper Motors via i2s extender.
Working PWM for Controller, E0,E.. FANS via i2s extender in split mode