Skip to content

armgit / flix

Public Imported from GitHub
0

Making an ESP32-based quadcopter from scratch

Minor fix in joystick support for simulation Don't use channels variable as it breaks code isolation

Oleg Kalachev641e711e67ec
diff --git a/gazebo/joystick.h b/gazebo/joystick.h
index 9056191..22c3402 100644
--- a/gazebo/joystick.h
+++ b/gazebo/joystick.h
@@ -29,7 +29,7 @@ bool joystickInit() {
bool joystickGet(int16_t ch[16]) {
SDL_JoystickUpdate();
- for (uint8_t i = 0; i < sizeof(channels) / sizeof(channels[0]); i++) {
+ for (uint8_t i = 0; i < 16; i++) {
ch[i] = SDL_JoystickGetAxis(joystick, i);
}
return true;