Skip to content

Opta Controller: Get pwm functions used wrong index#11

Merged
maidnl merged 3 commits intoarduino-libraries:mainfrom
maidnl:get_PWM_functions_used_wrong_index
Sep 11, 2024
Merged

Opta Controller: Get pwm functions used wrong index#11
maidnl merged 3 commits intoarduino-libraries:mainfrom
maidnl:get_PWM_functions_used_wrong_index

Conversation

@maidnl
Copy link
Contributor

@maidnl maidnl commented Sep 10, 2024

This PR corrects the behavior of Get PWM functions:

uint32_t getPwmPeriod(uint8_t ch);
uint32_t getPwmPulse(uint8_t ch);
float getPwmFreqHz(uint8_t ch);
float getPwmPulsePerc(uint8_t ch);

Those functions accepted as ch parameter a number from 0 to 3. This was not aligned with the setPwm() function that required its ch parameter to be from OA_PWM_CH_0 to OA_PWM_CH_3.
Now the "get" functions accept as channel OA_PWM_CH_0 ... OA_PWM_CH_3 as parameter.
It has been maintained the old behavior (in order to maintain compatibility) so a user can continue to use 0..3 as parameter however this practice is deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants