ICM20948 DMP代码详解(53)
接前一篇文章:ICM20948 DMP代码详解(52)
本回继续讲解inv_icm20948_compass_dmp_cal函数后续内容。为了便于理解和回顾,再次贴出inv_icm20948_compass_dmp_cal函数代码,在EMD-Core\sources\Invn\Devices\Drivers\ICM20948\Icm20948AuxCompassAkm.c中,如下:
/**
*  @brief      Set up the soft-iron matrix for compass in DMP.
*  @param[in]  Accel/Gyro mounting matrix
*  @param[in]  Compass mounting matrix
*  @return     0 if successful.
*/int inv_icm20948_compass_dmp_cal(struct inv_icm20948 *s, const signed char *m, const signed char *compass_m)
{int8_t trans[NINE_ELEM];int tmp_m[NINE_ELEM];int i, j, k;int sens[THREE