добавил все для наземной станции
This commit is contained in:
29
ground/joystick-reader.h
Normal file
29
ground/joystick-reader.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H
|
||||
#define SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <SDL.h>
|
||||
#else
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
class JoystickReader {
|
||||
public:
|
||||
JoystickReader(int frequency = 50);
|
||||
~JoystickReader();
|
||||
|
||||
bool initialize();
|
||||
bool readData(std::vector<uint16_t>& data);
|
||||
std::string getJoystickName() const;
|
||||
|
||||
private:
|
||||
SDL_Joystick* joystick;
|
||||
int updateIntervalMs;
|
||||
std::string joystickName;
|
||||
};
|
||||
|
||||
#endif //SDRPI_FPV_CONTROL_GROUND_JOYSTICK_READER_H
|
||||
Reference in New Issue
Block a user