Fix FastCRChw and other warnings

This commit is contained in:
Bruno Bousquet 2019-04-07 13:12:27 -04:00
parent e84c809740
commit 73d2ecedc8
2 changed files with 8 additions and 8 deletions

3
speeduino/src/FastCRC/FastCRChw.cpp Executable file → Normal file
View File

@ -385,7 +385,8 @@ FastCRC32::FastCRC32(){
uint32_t FastCRC32::crc32(const uint8_t *data, const uint16_t datalen, bool reflect)
{
// poly=0x04c11db7 init=0xffffffff refin=true refout=true xorout=0xffffffff check=0xcbf43926
return generic(0x04C11DB7L, 0XFFFFFFFFL, CRC_FLAG_REFLECT | CRC_FLAG_XOR, data, datalen);
uint32_t flags = CRC_FLAG_REFLECT | (reflect ? CRC_FLAG_XOR : 0);
return generic(0x04C11DB7L, 0XFFFFFFFFL, flags, data, datalen);
}
/** CKSUM

13
speeduino/src/SPIAsEEPROM/SPIFlashIO.cpp Executable file → Normal file
View File

@ -260,7 +260,6 @@
//Reads/Writes next data buffer. Should be called after _beginSPI()
void SPIFlash::_nextBuf(uint8_t opcode, uint8_t *data_buffer, uint32_t size) {
uint8_t *_dataAddr = &(*data_buffer);
switch (opcode) {
case READDATA:
#if defined (ARDUINO_ARCH_SAM)
@ -274,9 +273,9 @@
#elif defined (ARDUINO_ARCH_AVR)
SPI.transfer(&(*data_buffer), size);
#else
for (uint16_t i = 0; i < size; i++) {
*_dataAddr = xfer(NULLBYTE);
_dataAddr++;
while(size--) {
*data_buffer = xfer(NULLBYTE);
data_buffer++;
}
#endif
break;
@ -293,9 +292,9 @@
#elif defined (ARDUINO_ARCH_AVR)
SPI.transfer(&(*data_buffer), size);
#else
for (uint16_t i = 0; i < size; i++) {
xfer(*_dataAddr);
_dataAddr++;
while(size--) {
xfer(*data_buffer);
data_buffer++;
}
#endif
break;