mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-22 22:19:14 +01:00
uninitialized fix
This commit is contained in:
parent
bd5391a03f
commit
76296a44d8
@ -38,7 +38,7 @@ static uint8_t status_data[12] = {
|
|||||||
static uint32_t update_checksum (uint32_t address, uint32_t length) {
|
static uint32_t update_checksum (uint32_t address, uint32_t length) {
|
||||||
uint32_t remaining = length;
|
uint32_t remaining = length;
|
||||||
uint32_t block_size;
|
uint32_t block_size;
|
||||||
uint32_t checksum;
|
uint32_t checksum = 0;
|
||||||
uint8_t buffer[32];
|
uint8_t buffer[32];
|
||||||
|
|
||||||
hw_crc32_reset();
|
hw_crc32_reset();
|
||||||
@ -46,7 +46,7 @@ static uint32_t update_checksum (uint32_t address, uint32_t length) {
|
|||||||
for (uint32_t i = 0; i < length; i += sizeof(buffer)) {
|
for (uint32_t i = 0; i < length; i += sizeof(buffer)) {
|
||||||
block_size = (remaining > sizeof(buffer)) ? sizeof(buffer) : remaining;
|
block_size = (remaining > sizeof(buffer)) ? sizeof(buffer) : remaining;
|
||||||
fpga_mem_read(address, block_size, buffer);
|
fpga_mem_read(address, block_size, buffer);
|
||||||
checksum = hw_crc32_calculate(buffer, sizeof(buffer));
|
checksum = hw_crc32_calculate(buffer, block_size);
|
||||||
remaining -= block_size;
|
remaining -= block_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user