kopia lustrzana https://github.com/OpenRTX/OpenRTX
On Linux target emulate PTT button with P key
rodzic
fdd50c114c
commit
a8b838bd47
|
@ -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()
|
||||
|
|
Ładowanie…
Reference in New Issue