Gyro scaled output result not needed in RAM

This commit is contained in:
Bertrand Songis
2019-04-05 15:28:44 +02:00
parent 167849cee8
commit 73fa1c59b1
4 changed files with 17 additions and 8 deletions
+10 -1
View File
@@ -44,8 +44,17 @@ class Gyro {
public:
int16_t outputs[2];
int16_t scaled_outputs[2];
void wakeup();
int16_t scaledX()
{
return limit(-RESX, (int)(outputs[0] - g_eeGeneral.gyroOffset * RESX/180) * (180 / (GYRO_MAX_DEFAULT + g_eeGeneral.gyroMax)), RESX);
}
int16_t scaledY()
{
return limit(-RESX, outputs[1] * (180 / (GYRO_MAX_DEFAULT + g_eeGeneral.gyroMax)), RESX);
}
};
extern Gyro gyro;