You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/05/14 06:33:23 UTC

[incubator-nuttx] 23/23: stm32 nunchuck: small fixes

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c86258c9a07f797769d694230ed66b14e3854b30
Author: Matias Nitsche <mn...@dc.uba.ar>
AuthorDate: Wed May 13 18:19:49 2020 -0300

    stm32 nunchuck: small fixes
---
 boards/arm/stm32/common/src/stm32_nunchuck.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/boards/arm/stm32/common/src/stm32_nunchuck.c b/boards/arm/stm32/common/src/stm32_nunchuck.c
index 4cfa94c..29787f2 100644
--- a/boards/arm/stm32/common/src/stm32_nunchuck.c
+++ b/boards/arm/stm32/common/src/stm32_nunchuck.c
@@ -83,7 +83,7 @@
 int board_nunchuck_initialize(int devno, int busno)
 {
   FAR struct i2c_master_s *i2c;
-  char devpath[14];
+  char devpath[15];
   int ret;
 
   iinfo("Initializing Wii Nunchuck!\n");
@@ -98,10 +98,10 @@ int board_nunchuck_initialize(int devno, int busno)
 
   /* Register the joystick device as /dev/nunchuck0 */
 
-  iinfo("Initialize joystick driver: %s\n", devname);
+  snprintf(devpath, 15, "/dev/nunchuck%d", devno);
+  iinfo("Initialize joystick driver: %s\n", devpath);
 
-  snprintf(devpath, 14, "/dev/nunchuck%d", devno);
-  ret = nunchuck_register(devname, i2c);
+  ret = nunchuck_register(devpath, i2c);
   if (ret < 0)
     {
       ierr("ERROR: nunchuck_register failed: %d\n", ret);