My point is that you should avoid the copy/past of basically all these lines with just the buf changed.
What you should do instead is something like
```
#ifdef  USE_CHIBIOS_RTOS
#define MSG_BUF imu_gx3.gx3_data_buffer
#else
#define MSG_BUF imu_gx3.gx3_packet.msg_buf
#endif

imuf.accel.x     = bef(&MSG_BUF[1]);
```
or
```
#ifdef  USE_CHIBIOS_RTOS
uint8_t *buf = imu_gx3.gx3_data_buffer;
#else
uint8_t *buf = imu_gx3.gx3_packet.msg_buf;
#endif

imuf.accel.x     = bef(&buf[1]);
```