stm32 nunchuck: small fixes

This commit is contained in:
Matias Nitsche 2020-05-13 18:19:49 -03:00 committed by Alin Jerpelea
parent e0d21275df
commit c86258c9a0

View File

@ -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);