Question
I am using MotionDI library with sensortile (STEVAL-STLKT01V1).I modified the existing 'DataLog' application to include MotionDI_update function. But the MotionDI_update function halts after giving the rotation and acceleration once. How to resolve t
rptr = evt.value.p;
if(LoggingInterface == USB_Datalog)
{
/*** Using Dynamic Inclinometer algorithm ***/
//Timer_OR_DataRate_Interrupt_Handler()
//{
MDI_input_t data_in;
MDI_output_t data_out;
/* Get acceleration X/Y/Z in g */
data_in.Acc[0] = rptr->acc.x;
data_in.Acc[1] = rptr->acc.y;
data_in.Acc[2] = rptr->acc.z;
/* Get angular rate X/Y/Z in dps */
data_in.Gyro[0] = rptr->gyro.x;
data_in.Gyro[1] = rptr->gyro.y;
data_in.Gyro[2] = rptr->gyro.z;
data_in.Timestamp = rptr->ms_counter;
//data_in.Timestamp = HAL_GetTick() * 1000;
/* Run Dynamic Inclinometer algorithm */
char msg[15];
size=sprintf(msg, "Debug Message\n");
osPoolFree(sensorPool_id, rptr); // free memory allocated for message
CDC_Fill_Buffer(( uint8_t * )msg, size);
//MX_DynamicInclinometer_Process();
MotionDI_update(&data_out, &data_in);
/* Use data_out – output data from Dynamic Inclinometer algorithm */
//}
// size = sprintf(data_s, "TimeStamp: %ld\r\n Acc_X: %d, Acc_Y: %d, Acc_Z :%d\r\n Gyro_X:%d, Gyro_Y:%d, Gyro_Z:%d\r\n Magn_X:%d, Magn_Y:%d, Magn_Z:%d\r\n Press:%5.2f, Temp:%5.2f, Hum:%4.1f\r\n",
size = sprintf(data_s, "TimeStamp: %ld\r\n x-Rotation: %d, y-Rotation: %d, z-Rotation: %d\r\n x_accel: %d, y_accel: %d, z_accel: %d\r\n",
data_in.Timestamp, (int)data_out.rotation[0], (int)data_out.rotation[1], (int)data_out.rotation[2],
(int)data_out.linear_acceleration[0], (int)data_out.linear_acceleration[1], (int)data_out.linear_acceleration[2]);
osPoolFree(sensorPool_id, rptr); // free memory allocated for message
BSP_LED_Toggle(LED1);
CDC_Fill_Buffer(( uint8_t * )data_s, size);
}
