fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. #define UINT16_T uint16_t
  5. #define UINT8_T uint8_t
  6.  
  7. UINT16_T CalcCRC16_Value(UINT16_T wCRC, UINT8_T byVal)
  8. {
  9. byVal = byVal ^ ((UINT8_T) (wCRC & 0x00FFU));
  10. byVal = byVal ^ (UINT8_T) (byVal << 4U);
  11. wCRC = (wCRC >> 8U);
  12. wCRC |= ((UINT16_T) byVal << 8U); //genauer gesagt: d.uint8[0] = byVal;
  13. wCRC ^= (byVal << 3U);
  14. wCRC ^= (UINT8_T) (byVal >> 4U);
  15.  
  16. return wCRC;
  17. }
  18.  
  19. int main(void) {
  20. // your code goes here
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 9296KB
stdin
Standard input is empty
stdout
Standard output is empty