summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a575eeb)
TM v3.0 uses the same log file format value as TM v2.0 but has a
different accelerometer, which requires a different function for
inverting the raw values. Detect v2.0 devices and use the old function
for them while using the new function for all others.
Signed-off-by: Keith Packard <keithp@keithp.com>
case AltosLib.AO_LOG_FORMAT_FULL:
return 0x7fff - value;
case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD:
case AltosLib.AO_LOG_FORMAT_FULL:
return 0x7fff - value;
case AltosLib.AO_LOG_FORMAT_TELEMEGA_OLD:
- case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
case AltosLib.AO_LOG_FORMAT_TELEMEGA:
case AltosLib.AO_LOG_FORMAT_TELEMEGA_3:
return 4095 - value;
case AltosLib.AO_LOG_FORMAT_TELEMEGA:
case AltosLib.AO_LOG_FORMAT_TELEMEGA_3:
return 4095 - value;
+ case AltosLib.AO_LOG_FORMAT_TELEMETRUM:
+ /*
+ * TeleMetrum v2 and later use the same log format, but
+ * have different accelerometers. This is the only place
+ * it matters in altoslib.
+ */
+ if (product.startsWith("TeleMetrum-v2"))
+ return 4095 - value;
+ /* fall through */
case AltosLib.AO_LOG_FORMAT_TELEMEGA_4:
case AltosLib.AO_LOG_FORMAT_EASYMEGA_2:
case AltosLib.AO_LOG_FORMAT_EASYMOTOR:
case AltosLib.AO_LOG_FORMAT_TELEMEGA_4:
case AltosLib.AO_LOG_FORMAT_EASYMEGA_2:
case AltosLib.AO_LOG_FORMAT_EASYMOTOR: