On Linux target emulate PTT button with P key

This commit is contained in:
Federico Amedeo Izzo 2021-07-08 20:24:27 +02:00
parent fdd50c114c
commit a8b838bd47
1 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#include <interfaces/gpio.h>
#include <stdio.h>
#include "emulator.h"
#include <SDL2/SDL.h>
hwInfo_t hwInfo;
@ -76,7 +77,13 @@ int8_t platform_getChSelector()
bool platform_getPttStatus()
{
return Radio_State.PttStatus;
// Read P key status from SDL
SDL_PumpEvents();
const uint8_t *state = SDL_GetKeyboardState(NULL);
if (state[SDL_SCANCODE_P])
return true;
else
return false;
}
bool platform_pwrButtonStatus()