Skip to content

Commit 6fcd9c6

Browse files
authored
Merge pull request #15302 from yutotnh/rename-read_pulsewitdth_us
rename: PwmOut::read_pulsewitdth_us() to PwmOut::read_pulsewidth_us()
2 parents bc6be80 + 0992a6c commit 6fcd9c6

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

drivers/include/drivers/PwmOut.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,15 @@ class PwmOut {
133133

134134
/** Read the PWM pulsewidth
135135
* @returns
136-
* The PWM pulsewith, specified in microseconds (int)
136+
* The PWM pulsewidth, specified in microseconds (int)
137137
*/
138+
int read_pulsewidth_us();
139+
140+
/** Read the PWM pulsewidth
141+
* @returns
142+
* The PWM pulsewidth, specified in microseconds (int)
143+
*/
144+
MBED_DEPRECATED("use read_pulsewidth_us() instead")
138145
int read_pulsewitdth_us();
139146

140147
/** Suspend PWM operation

drivers/source/PwmOut.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,19 @@ void PwmOut::pulsewidth_us(int us)
113113
core_util_critical_section_exit();
114114
}
115115

116-
int PwmOut::read_pulsewitdth_us()
116+
int PwmOut::read_pulsewidth_us()
117117
{
118118
core_util_critical_section_enter();
119119
auto val = pwmout_read_pulsewidth_us(&_pwm);
120120
core_util_critical_section_exit();
121121
return val;
122122
}
123123

124+
int PwmOut::read_pulsewitdth_us()
125+
{
126+
return read_pulsewidth_us();
127+
}
128+
124129
void PwmOut::suspend()
125130
{
126131
core_util_critical_section_enter();

hal/include/hal/pwmout_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void pwmout_pulsewidth_us(pwmout_t *obj, int us);
158158
/** Read the PWM pulsewidth specified in microseconds
159159
*
160160
* @param obj The pwmout object
161-
* @return A int output pulsewitdth
161+
* @return A int output pulsewidth
162162
*/
163163
int pwmout_read_pulsewidth_us(pwmout_t *obj);
164164

0 commit comments

Comments
 (0)