Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion drivers/include/drivers/PwmOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,15 @@ class PwmOut {

/** Read the PWM pulsewidth
* @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();

/** Suspend PWM operation
Expand Down
7 changes: 6 additions & 1 deletion drivers/source/PwmOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@ void PwmOut::pulsewidth_us(int us)
core_util_critical_section_exit();
}

int PwmOut::read_pulsewitdth_us()
int PwmOut::read_pulsewidth_us()
{
core_util_critical_section_enter();
auto val = pwmout_read_pulsewidth_us(&_pwm);
core_util_critical_section_exit();
return val;
}

int PwmOut::read_pulsewitdth_us()
{
return read_pulsewidth_us();
}

void PwmOut::suspend()
{
core_util_critical_section_enter();
Expand Down
2 changes: 1 addition & 1 deletion hal/include/hal/pwmout_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void pwmout_pulsewidth_us(pwmout_t *obj, int us);
/** Read the PWM pulsewidth specified in microseconds
*
* @param obj The pwmout object
* @return A int output pulsewitdth
* @return A int output pulsewidth
*/
int pwmout_read_pulsewidth_us(pwmout_t *obj);

Expand Down