mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fix signed/unsigned comparison.
This commit is contained in:
parent
715fef691f
commit
a4e9521c4a
1 changed files with 2 additions and 2 deletions
|
@ -20,8 +20,8 @@ uint8_t StatusInputCommand[]{0x05, 0xFF, 0xDA};
|
||||||
|
|
||||||
// Returns first byte of the sum of given bytes.
|
// Returns first byte of the sum of given bytes.
|
||||||
uint8_t Checksum(const uint8_t *data, uint16_t nbytes) {
|
uint8_t Checksum(const uint8_t *data, uint16_t nbytes) {
|
||||||
int sum = 0;
|
uint64_t sum = 0;
|
||||||
for (int i = 0; i < nbytes; i++) {
|
for (uint16_t i = 0; i < nbytes; i++) {
|
||||||
sum += data[i];
|
sum += data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue