mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Flip SC7
This commit is contained in:
@@ -210,6 +210,7 @@
|
||||
#define TEMP_NTC
|
||||
#define I2C_SOFT
|
||||
#define LIS_ORI_FLIP
|
||||
#define SC7_ORI_FLIP
|
||||
#define OLED_FLIP
|
||||
#endif
|
||||
|
||||
|
||||
@@ -18,11 +18,19 @@ public:
|
||||
// 1 = rh, 2,=lh, 8=flat
|
||||
static Orientation getOrientation() {
|
||||
uint8_t val = ((FRToSI2C::I2C_RegisterRead(activeAddress, SC7A20_INT2_SOURCE) >> 2) - 1);
|
||||
if (val == 1)
|
||||
return Orientation::ORIENTATION_LEFT_HAND;
|
||||
else if (val == 4 || val == 0)
|
||||
if (val == 1) {
|
||||
#ifdef SC7_ORI_FLIP
|
||||
return Orientation::ORIENTATION_RIGHT_HAND;
|
||||
else
|
||||
#else
|
||||
return Orientation::ORIENTATION_LEFT_HAND;
|
||||
#endif
|
||||
} else if (val == 4 || val == 0) {
|
||||
#ifdef SC7_ORI_FLIP
|
||||
return Orientation::ORIENTATION_LEFT_HAND;
|
||||
#else
|
||||
return Orientation::ORIENTATION_RIGHT_HAND;
|
||||
#endif
|
||||
} else
|
||||
return Orientation::ORIENTATION_FLAT;
|
||||
}
|
||||
static void getAxisReadings(int16_t &x, int16_t &y, int16_t &z);
|
||||
|
||||
Reference in New Issue
Block a user