void ReaddataTask02(void *argument)
{
  /* USER CODE BEGIN ReaddataTask02 */
  /* Infinite loop */
	uint8_t fdc2214_initready1 = 0;
	uint8_t fdc2214_initready2 = 0;

  uint8_t device1IDValid = 0; // 设备ID是否有效的标志
	uint8_t device2IDValid = 0; // 设备ID是否有效的标志	
	
	uint32_t lastCheck1Time = 0; // 记录上次检查时间
	uint32_t lastCheck2Time = 0; // 记录上次检查时间
  const uint32_t checkInterval = 5000; // 5秒检查间隔（毫秒）
	
	SoftI2C_Init(&hi2c1);
	SoftI2C_Init(&hi2c2);

	osDelay(10);
	
  for(;;)
  {
		device1IDValid =1;
		device2IDValid =1;
		
		uint32_t now = HAL_GetTick();
		
		// 检查设备1
    if ((now - lastCheck1Time) >= checkInterval)
    {
      lastCheck1Time = now;
      CheckFDC2214_ID(&hi2c1, 1, &device1IDValid);
    }
		if (device1IDValid)
    {
			printf("1\n");
			// 第一个电容
			ProcessFDC2214(&hi2c1, filterqueue1Handle, &fdc2214_initready1, &device1IDValid, 0, 18, 33, 43.1f, 1);
		}
		now = HAL_GetTick();
		// 检查设备2
    if ((now - lastCheck2Time) >= checkInterval)
    {
      lastCheck2Time = now;
      CheckFDC2214_ID(&hi2c2, 2, &device2IDValid);
    }
		if (device2IDValid)
    {
			printf("2\n");
			// 第二个电容
			ProcessFDC2214(&hi2c2, filterqueue2Handle, &fdc2214_initready2, &device2IDValid, 0, 18, 33, 43.1f, 2);
		}
    osDelay(20);
  }
  /* USER CODE END ReaddataTask02 */
}
