43 lines
815 B
C++
43 lines
815 B
C++
#ifndef TJDUI_APP_CAMERA_MODEL_H
|
|
#define TJDUI_APP_CAMERA_MODEL_H
|
|
|
|
#include "cmsis_os2.h"
|
|
#include <cstdint>
|
|
#include <chrono>
|
|
#include <thread>
|
|
#include <cmath>
|
|
|
|
namespace TJD {
|
|
|
|
struct GsensorData
|
|
{
|
|
int16_t x;
|
|
int16_t y;
|
|
int16_t z;
|
|
};
|
|
|
|
class TjdUiAppCameraModel
|
|
{
|
|
public:
|
|
TjdUiAppCameraModel() {};
|
|
~TjdUiAppCameraModel() {};
|
|
static TjdUiAppCameraModel &GetInstance(void)
|
|
{
|
|
static TjdUiAppCameraModel instance;
|
|
return instance;
|
|
};
|
|
GsensorData &GetGsensorData(void);
|
|
bool isGiveShake(void); //判断是否是摇一摇
|
|
bool CanUploadTakePhotoCmd(void);
|
|
void CloseAutoScreenOff(void);
|
|
void OpenAutoScreenOff(void);
|
|
|
|
private:
|
|
osThreadId_t gameTaskHandel_;
|
|
GsensorData data_;
|
|
uint64_t lastShakeTime_ = 0;
|
|
};
|
|
|
|
} // namespace TJD
|
|
|
|
#endif |