You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/09/02 13:18:54 UTC
[mynewt-core] 01/02: apps/pwm_test: Fix pin handling for STM32
This is an automated email from the ASF dual-hosted git repository.
jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 36f1cb224043024936f475c1b802628863fc09f7
Author: Jerzy Kasenberg <je...@apache.org>
AuthorDate: Thu Sep 2 07:04:02 2021 +0200
apps/pwm_test: Fix pin handling for STM32
STM32 PWM driver encodes alternate pin function
at higher bits of pin definition.
Definition of pins with alternate function > 0 are 16 bits long,
where bits 12:15 specify function.
pwm_shell assumed that 8 bits is enough for pin number, but it will
not work for most ST cases.
This changes local variable type to accommodate ST encoding of pins
with alternate function.
---
apps/pwm_test/src/pwm_shell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/pwm_test/src/pwm_shell.c b/apps/pwm_test/src/pwm_shell.c
index d273a9d..919c18c 100644
--- a/apps/pwm_test/src/pwm_shell.c
+++ b/apps/pwm_test/src/pwm_shell.c
@@ -182,7 +182,7 @@ static const struct shell_cmd_help start_help = {
static int
cmd_start(int argc, char **argv)
{
- uint8_t pin = LED_BLINK_PIN;
+ int pin = LED_BLINK_PIN;
char *tmp;
char *pwm = "pwm0";
int freq = 200;