Skip to content

Commit 246b803

Browse files
rzryichoi
authored andcommitted
nuttx: Use unix convention for number for PWM file (#1887)
Pre UNIX convention devices start on 0 index while STM32 timers start on 1. So a -1 shift is applied: eg: /dev/pwm0 is for used Timer1 It was tested along nucleo-144 (stm32f7) port Relate-to: https://bitbucket.org/nuttx/nuttx/pull-requests/874/ Relate-to: rzr/webthing-iotjs#3 Forwarded: #1887 Change-Id: Ia0b468bcb203f94107e472f837a5d38dbcfee71d IoT.js-DCO-1.0-Signed-off-by: Philippe Coval p.coval@samsung.com
1 parent 603bea5 commit 246b803

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/nuttx/iotjs_module_pwm-nuttx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool iotjs_pwm_open(iotjs_pwm_t* pwm) {
8585
char path[PWM_DEVICE_PATH_BUFFER_SIZE] = { 0 };
8686

8787
if (snprintf(path, PWM_DEVICE_PATH_BUFFER_SIZE, PWM_DEVICE_PATH_FORMAT,
88-
timer) < 0) {
88+
(timer - 1)) < 0) {
8989
return false;
9090
}
9191

0 commit comments

Comments
 (0)