Updated for checksum
Diff: main.cpp
- Revision:
- 14:6fec697f62ef
- Parent:
- 13:87e7ce883f6a
- Child:
- 15:56a06363a698
--- a/main.cpp Fri Feb 04 19:42:10 2022 +0000 +++ b/main.cpp Fri Feb 04 22:38:23 2022 +0000 @@ -535,8 +535,10 @@ //update crc_chk from buffer spi_command = tmp_crc_chk; //do math on the input - process(); - //control(); + //process(); + control(); + PackAll(); + WriteAll(); //new_command = 1; //print_SPI_command(); } @@ -757,7 +759,8 @@ //PackAll(); //WriteAll(); } - spi_data.checksum = xor_checksum((uint32_t*)&spi_data,14); //OK THIS LINE ISN'T SETTING THE CHECKSUM B/C SETTINNG IT TO 10 DID NOTHIGN + // UPDATE CHECKSUM + spi_data.checksum = xor_checksum((uint32_t*)&spi_data, 30); for(int i = 0; i < DATA_LEN; i++){ tx_buff[i] = ((uint16_t*)(&spi_data))[i];}