triton.cpp 448 B

1234567891011121314151617
  1. #include "triton.h"
  2. // Copied from OpenPuck/triton.cpp. g_in is the shared input struct; imuFrom45 documents the IMU byte
  3. // offsets that report45.cpp inverts when encoding.
  4. PuckInput g_in;
  5. void imuFrom45(const uint8_t *r, int16_t *ax, int16_t *ay, int16_t *az,
  6. int16_t *gx, int16_t *gy, int16_t *gz)
  7. {
  8. *ax = s16off(r, 32);
  9. *ay = s16off(r, 34);
  10. *az = s16off(r, 36);
  11. *gx = s16off(r, 38);
  12. *gy = s16off(r, 40);
  13. *gz = s16off(r, 42);
  14. }