Support MAVLink usage in simulation

This commit is contained in:
Oleg Kalachev
2024-01-31 12:10:18 +03:00
parent 4850b95029
commit f718af7f0e
9 changed files with 78 additions and 11 deletions

View File

@@ -41,10 +41,10 @@ void joystickInit() {
memcpy(channelMax, channelMaxOverride, sizeof(channelMaxOverride));
}
void joystickGet() {
bool joystickGet() {
if (!joystickInitialized) {
joystickInit();
return;
return false;
}
SDL_JoystickUpdate();
@@ -54,4 +54,5 @@ void joystickGet() {
}
channels[RC_CHANNEL_MODE] = SDL_JoystickGetButton(joystick, 0) ? 1 : 0;
controls[RC_CHANNEL_MODE] = channels[RC_CHANNEL_MODE];
return true;
}