We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82bf21b commit 4f92bc5Copy full SHA for 4f92bc5
firmware/nRF51/tag-proximity/src/log.c
@@ -141,8 +141,8 @@ static void flash_log_block_commit(void)
141
/* get timestamp */
142
LogBlock.env.epoch = get_time();
143
144
- /* compute CRC, ignoring signature and CRC fields */
145
- LogBlock.env.crc = crc32( ((void *) &LogBlock) + 8, sizeof(LogBlock) - 8);
+ /* compute CRC, ignoring signature and CRC fields (8 bytes) */
+ LogBlock.env.crc = crc32( ((void *) &LogBlock) + 8, LOG_BLOCK_DATA_SIZE + sizeof(LogBlock.env) - 8);
146
147
/* write block */
148
err = flash_log_block_write(current_block, (uint8_t *) &LogBlock );
0 commit comments