42 lines
732 B
C++
42 lines
732 B
C++
#ifndef TJD_UI_APP_MS_GAME_MODEL_H
|
|
#define TJD_UI_APP_MS_GAME_MODEL_H
|
|
|
|
#include "cmsis_os2.h"
|
|
#include <cstdint>
|
|
|
|
extern "C" {
|
|
#include "gsensor_port.h"
|
|
}
|
|
|
|
namespace TJD {
|
|
|
|
struct GsensorData
|
|
{
|
|
int16_t x;
|
|
int16_t y;
|
|
int16_t z;
|
|
};
|
|
|
|
class TjdUiAppMSGameModel
|
|
{
|
|
public:
|
|
TjdUiAppMSGameModel() {};
|
|
~TjdUiAppMSGameModel() {};
|
|
static TjdUiAppMSGameModel &GetInstance(void)
|
|
{
|
|
static TjdUiAppMSGameModel instance;
|
|
return instance;
|
|
};
|
|
GsensorData &GetGsensorData(void);
|
|
bool UploadGsensorData(const game_data_struct &data);
|
|
void EnterMsGameEvent(void);
|
|
void ExitMsGameEvent(void);
|
|
|
|
private:
|
|
osThreadId_t gameTaskHandel_;
|
|
GsensorData data_;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |