代码加打印:
VL53L0X_Error VL53L0X_GetInterruptMaskStatus(VL53L0X_DEV Dev,
uint32_t *pInterruptMaskStatus)
{
VL53L0X_Error Status = VL53L0X_ERROR_NONE;
uint8_t Byte;
LOG_FUNCTION_START("");
Status = VL53L0X_RdByte(Dev, VL53L0X_REG_RESULT_INTERRUPT_STATUS, &Byte);
*pInterruptMaskStatus = Byte & 0x07;
printf("wangling 111 VL53L0X_GetInterruptMaskStatus status = %d, Byte = 0x%02x\r\n", Status, Byte);
if (Byte & 0x18)
Status = VL53L0X_ERROR_RANGE_ERROR;
LOG_FUNCTION_END(Status);
return Status;
}
打印结果:
wangling 111 VL53L0X_GetInterruptMaskStatus status = 0, Byte = 0x48
进入了异常流程:
if (Byte & 0x18)
Status = VL53L0X_ERROR_RANGE_ERROR;
|