1
0
forked from me/IronOS

Further work on Pinecil compile

This commit is contained in:
Ben V. Brown
2020-08-18 18:58:00 +10:00
parent 3560f6c5c1
commit 2becaa5eab
22 changed files with 1214 additions and 1260 deletions

View File

@@ -11,15 +11,18 @@
#include "LIS2DH12_defines.hpp"
#include "BSP.h"
class LIS2DH12 {
class LIS2DH12
{
public:
static bool detect();
static void initalize();
//1 = rh, 2,=lh, 8=flat
static Orientation getOrientation() {
static Orientation getOrientation()
{
#ifdef LIS_ORI_FLIP
uint8_t val = (FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS,
LIS_INT2_SRC) >> 2);
LIS_INT2_SRC) >>
2);
if (val == 8)
val = 3;
else if (val == 1)
@@ -30,11 +33,13 @@ public:
val = 3;
return static_cast<Orientation>(val);
#endif
#ifdef MODEL_TS100
return static_cast<Orientation>((FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS,LIS_INT2_SRC) >> 2) - 1);
#ifdef ACCEL_LIS
return static_cast<Orientation>((FRToSI2C::I2C_RegisterRead(LIS2DH_I2C_ADDRESS, LIS_INT2_SRC) >> 2) - 1);
#else
return Orientation::ORIENTATION_FLAT;
#endif
}
static void getAxisReadings(int16_t& x, int16_t& y, int16_t& z);
static void getAxisReadings(int16_t &x, int16_t &y, int16_t &z);
private:
};