refactor: SD card SPI HAL (#3957)
* refactor: SD card SPI driver * Removed SPI and DMA StdPeriph drivers * Allow for disabling SPI DMA support * Disable SPI sdcard CRC support * Fix 2MHz timer on NV14 * Shared VS1053b driver * Fix: SPI2 uses PCLK1 * feat: new generic diskio API * More generic SD_CARD_PRESENT() * Fixes * Flush incoming block on token mismatch * Scratch buffer test * Incredible hack to re-sync sd card * fix: SDIO driver
This commit is contained in:
+2
-2
@@ -101,8 +101,8 @@ uint16_t crc16(uint8_t index, const uint8_t * buf, uint32_t len, uint16_t start)
|
||||
{
|
||||
uint16_t crc = start;
|
||||
const unsigned short * tab = crc16tab[index];
|
||||
for (uint32_t i=0; i<len; i++) {
|
||||
crc = (crc<<8) ^ tab[((crc>>8) ^ *buf++) & 0x00FF];
|
||||
for (uint32_t i = 0; i < len; i++) {
|
||||
crc = (crc << 8) ^ tab[((crc >> 8) ^ *buf++) & 0x00FF];
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user