CMD0x33_Request_ReadProbeFactoryInfo.c 914 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "CommandsDefine.h"
  2. #include "ProjectConfig.h"
  3. #include "ProbeEEPROM.h"
  4. #include "PCA9548.h"
  5. #include "Helper.h"
  6. #include "usart.h"
  7. void CMD0x33_Request_ReadProbeFactoryInfo_process(u8 *pData,u16 dataLen,u8 bIsContentBitInverted_Recv,u8 bIsContentBitInverted_SendBack)
  8. {
  9. #ifdef RUNNING_WHERE_AT_BOOT
  10. Command_SendbackErrorMessage(Error0x02_CannotRunAtBoot);
  11. #else
  12. u8 bDataOK=1;
  13. u8 validDataLength=dataLen;
  14. if (bIsContentBitInverted_Recv)
  15. {
  16. validDataLength=dataLen/2;
  17. if (!Helper_CheckInvertBytesIsRegist(pData,dataLen))
  18. bDataOK=0;
  19. }
  20. if (validDataLength!=1)
  21. bDataOK=0;
  22. if (!bDataOK)
  23. {
  24. Command_SendbackErrorMessage(Error0x05_CMD_ParaLentghError,1);
  25. return;
  26. }
  27. u16 dataBytes = EEPROM_DATA_LEN;
  28. dataBytes = ProbeEEPROM_Read(pData,USART_WR_BUF);
  29. u8 test = PCA9548_Read();
  30. USART6_Send(CMD0x33_Request_ReadProbeFactoryInfo,dataBytes,bIsContentBitInverted_SendBack);
  31. #endif
  32. }