Merge pull request #15302 from yutotnh/rename-read_pulsewitdth_us

rename: PwmOut::read_pulsewitdth_us() to PwmOut::read_pulsewidth_us()
pull/15306/head
Martin Kojtal 2022-06-27 14:41:02 +01:00 committed by GitHub
commit 6fcd9c617f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -133,8 +133,15 @@ public:
/** Read the PWM pulsewidth /** Read the PWM pulsewidth
* @returns * @returns
* The PWM pulsewith, specified in microseconds (int) * The PWM pulsewidth, specified in microseconds (int)
*/ */
int read_pulsewidth_us();
/** Read the PWM pulsewidth
* @returns
* The PWM pulsewidth, specified in microseconds (int)
*/
MBED_DEPRECATED("use read_pulsewidth_us() instead")
int read_pulsewitdth_us(); int read_pulsewitdth_us();
/** Suspend PWM operation /** Suspend PWM operation

View File

@ -113,7 +113,7 @@ void PwmOut::pulsewidth_us(int us)
core_util_critical_section_exit(); core_util_critical_section_exit();
} }
int PwmOut::read_pulsewitdth_us() int PwmOut::read_pulsewidth_us()
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();
auto val = pwmout_read_pulsewidth_us(&_pwm); auto val = pwmout_read_pulsewidth_us(&_pwm);
@ -121,6 +121,11 @@ int PwmOut::read_pulsewitdth_us()
return val; return val;
} }
int PwmOut::read_pulsewitdth_us()
{
return read_pulsewidth_us();
}
void PwmOut::suspend() void PwmOut::suspend()
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();

View File

@ -158,7 +158,7 @@ void pwmout_pulsewidth_us(pwmout_t *obj, int us);
/** Read the PWM pulsewidth specified in microseconds /** Read the PWM pulsewidth specified in microseconds
* *
* @param obj The pwmout object * @param obj The pwmout object
* @return A int output pulsewitdth * @return A int output pulsewidth
*/ */
int pwmout_read_pulsewidth_us(pwmout_t *obj); int pwmout_read_pulsewidth_us(pwmout_t *obj);