Feat current sense check if TRGO set for STM32 #456
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.
This PR adds a check in the ADC code that verifies that the timer to which the ADC will be synced does not have TRGO events already in use.
They can be used in two ways:
This code was not necessary for the releases up to v2.3.4 as the driver sync was done after the ADC sync initialisaiton. Then the driver was the only one required to verify if the timers have TRGO in use. But in the new code, the driver is initalised first, and the ADC second, so the ADC code has to verify this as well.
I've also added to the code a check if the pins are ADC pins, and displayed the error. Up until now the init would fail without any error and block the operation.
I think that this PR is probably required for the v2.3.5, as without it the ADC code can overwrite the timer sync and create unaligned PWM signals. What do you think @runger1101001?