接前一篇文章:ICM20948 DMP代码详解(62)
上一回解析了inv_icm20948_set_accel_fullscale函数的第2段代码。本回解析最后一段代码。为了便于理解和回顾,再次贴出inv_icm20948_set_accel_fullscale函数代码,在EMD-Core\sources\Invn\Devices\Drivers\ICM20948\Icm20948DataBaseDriver.c中,如下:
int inv_icm20948_set_accel_fullscale(struct inv_icm20948 *s, int level)
{
int result;
s->base_state.accel_fullscale = level;
result = inv_icm20948_set_icm20948_accel_fullscale(s, level);
result |= dmp_icm20948_set_accel_fsr(s, 2<<level);
result |= dmp_icm20948_set_accel_scale2(s, 2<<level);
return result;
}
最后一段