From 6a4ba443ea423c996c96b57c72ada93f64d5e22c Mon Sep 17 00:00:00 2001 From: yutotnh <57719497+yutotnh@users.noreply.github.com> Date: Tue, 21 Jun 2022 23:25:43 +0900 Subject: [PATCH 1/4] rename: read_pulsewitdth_us to read_pulsewidth_us --- drivers/include/drivers/PwmOut.h | 2 +- drivers/source/PwmOut.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/include/drivers/PwmOut.h b/drivers/include/drivers/PwmOut.h index 462c5760b91..ab36804e5f7 100644 --- a/drivers/include/drivers/PwmOut.h +++ b/drivers/include/drivers/PwmOut.h @@ -135,7 +135,7 @@ class PwmOut { * @returns * The PWM pulsewith, specified in microseconds (int) */ - int read_pulsewitdth_us(); + int read_pulsewidth_us(); /** Suspend PWM operation * diff --git a/drivers/source/PwmOut.cpp b/drivers/source/PwmOut.cpp index ccada968ed7..1dd73bcd2d5 100644 --- a/drivers/source/PwmOut.cpp +++ b/drivers/source/PwmOut.cpp @@ -113,7 +113,7 @@ 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); From 7fe679c72ec490fbc00661df36977d231eff7cd3 Mon Sep 17 00:00:00 2001 From: yutotnh <57719497+yutotnh@users.noreply.github.com> Date: Wed, 22 Jun 2022 00:00:29 +0900 Subject: [PATCH 2/4] fix: typo in pwmout_api.h (pulsewitdth -> pulsewidth) --- hal/include/hal/pwmout_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/include/hal/pwmout_api.h b/hal/include/hal/pwmout_api.h index c606183931a..dc8fd84182e 100644 --- a/hal/include/hal/pwmout_api.h +++ b/hal/include/hal/pwmout_api.h @@ -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); From 236194f7c3961fca155db123131d59ba9c7629dc Mon Sep 17 00:00:00 2001 From: yutotnh <57719497+yutotnh@users.noreply.github.com> Date: Thu, 23 Jun 2022 21:59:03 +0900 Subject: [PATCH 3/4] add: PwmOut::read_pulsewitdth_us() for compatibility --- drivers/include/drivers/PwmOut.h | 7 +++++++ drivers/source/PwmOut.cpp | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/drivers/include/drivers/PwmOut.h b/drivers/include/drivers/PwmOut.h index ab36804e5f7..93b1ee56dd8 100644 --- a/drivers/include/drivers/PwmOut.h +++ b/drivers/include/drivers/PwmOut.h @@ -137,6 +137,13 @@ class PwmOut { */ int read_pulsewidth_us(); + /** Read the PWM pulsewidth + * @returns + * The PWM pulsewith, specified in microseconds (int) + */ + MBED_DEPRECATED("use read_pulsewidth_us() instead") + int read_pulsewitdth_us(); + /** Suspend PWM operation * * Control the PWM state. This is primarily intended diff --git a/drivers/source/PwmOut.cpp b/drivers/source/PwmOut.cpp index 1dd73bcd2d5..cc717f8e99a 100644 --- a/drivers/source/PwmOut.cpp +++ b/drivers/source/PwmOut.cpp @@ -121,6 +121,11 @@ int PwmOut::read_pulsewidth_us() return val; } +int PwmOut::read_pulsewitdth_us() +{ + return read_pulsewidth_us(); +} + void PwmOut::suspend() { core_util_critical_section_enter(); From 0992a6cc1177baf04ab90770a1bb85c70d540fef Mon Sep 17 00:00:00 2001 From: yutotnh <57719497+yutotnh@users.noreply.github.com> Date: Sat, 25 Jun 2022 08:21:51 +0900 Subject: [PATCH 4/4] fix: typo in PwmOut.h (pulsewith -> pulsewidth) --- drivers/include/drivers/PwmOut.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/include/drivers/PwmOut.h b/drivers/include/drivers/PwmOut.h index 93b1ee56dd8..9a901c4b758 100644 --- a/drivers/include/drivers/PwmOut.h +++ b/drivers/include/drivers/PwmOut.h @@ -133,13 +133,13 @@ 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 pulsewith, specified in microseconds (int) + * The PWM pulsewidth, specified in microseconds (int) */ MBED_DEPRECATED("use read_pulsewidth_us() instead") int read_pulsewitdth_us();