@@ -345,7 +345,7 @@ bool DiskIODriver_SPI_SD::init(const uint8_t sckRateID, const pin_t chipSelectPi
345
345
* \param[out] dst Pointer to the location that will receive the data.
346
346
* \return true for success, false for failure.
347
347
*/
348
- bool DiskIODriver_SPI_SD::readBlock (uint32_t blockNumber, uint8_t *dst) {
348
+ bool DiskIODriver_SPI_SD::readBlock (uint32_t blockNumber, uint8_t * const dst) {
349
349
#if IS_TEENSY_35_36 || IS_TEENSY_40_41
350
350
return 0 == SDHC_CardReadBlock (dst, blockNumber);
351
351
#endif
@@ -385,7 +385,7 @@ bool DiskIODriver_SPI_SD::readBlock(uint32_t blockNumber, uint8_t *dst) {
385
385
*
386
386
* \return true for success, false for failure.
387
387
*/
388
- bool DiskIODriver_SPI_SD::readData (uint8_t *dst) {
388
+ bool DiskIODriver_SPI_SD::readData (uint8_t * const dst) {
389
389
chipSelect ();
390
390
return readData (dst, 512 );
391
391
}
@@ -455,7 +455,7 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst) {
455
455
456
456
#endif // SD_CHECK_AND_RETRY
457
457
458
- bool DiskIODriver_SPI_SD::readData (uint8_t *dst, const uint16_t count) {
458
+ bool DiskIODriver_SPI_SD::readData (uint8_t * const dst, const uint16_t count) {
459
459
bool success = false ;
460
460
461
461
const millis_t read_timeout = millis () + SD_READ_TIMEOUT;
@@ -487,8 +487,8 @@ bool DiskIODriver_SPI_SD::readData(uint8_t *dst, const uint16_t count) {
487
487
}
488
488
489
489
/* * read CID or CSR register */
490
- bool DiskIODriver_SPI_SD::readRegister (const uint8_t cmd, void *buf) {
491
- uint8_t *dst = reinterpret_cast <uint8_t *>(buf);
490
+ bool DiskIODriver_SPI_SD::readRegister (const uint8_t cmd, void * const buf) {
491
+ uint8_t * const dst = reinterpret_cast <uint8_t *>(buf);
492
492
if (cardCommand (cmd, 0 )) {
493
493
error (SD_CARD_ERROR_READ_REG);
494
494
chipDeselect ();
@@ -567,7 +567,7 @@ void DiskIODriver_SPI_SD::error(const uint8_t code) { errorCode_ = code; }
567
567
* \param[in] src Pointer to the location of the data to be written.
568
568
* \return true for success, false for failure.
569
569
*/
570
- bool DiskIODriver_SPI_SD::writeBlock (uint32_t blockNumber, const uint8_t *src) {
570
+ bool DiskIODriver_SPI_SD::writeBlock (uint32_t blockNumber, const uint8_t * const src) {
571
571
if (ENABLED (SDCARD_READONLY)) return false ;
572
572
573
573
#if IS_TEENSY_35_36 || IS_TEENSY_40_41
@@ -598,7 +598,7 @@ bool DiskIODriver_SPI_SD::writeBlock(uint32_t blockNumber, const uint8_t *src) {
598
598
* \param[in] src Pointer to the location of the data to be written.
599
599
* \return true for success, false for failure.
600
600
*/
601
- bool DiskIODriver_SPI_SD::writeData (const uint8_t *src) {
601
+ bool DiskIODriver_SPI_SD::writeData (const uint8_t * const src) {
602
602
if (ENABLED (SDCARD_READONLY)) return false ;
603
603
604
604
bool success = true ;
@@ -613,7 +613,7 @@ bool DiskIODriver_SPI_SD::writeData(const uint8_t *src) {
613
613
}
614
614
615
615
// Send one block of data for write block or write multiple blocks
616
- bool DiskIODriver_SPI_SD::writeData (const uint8_t token, const uint8_t *src) {
616
+ bool DiskIODriver_SPI_SD::writeData (const uint8_t token, const uint8_t * const src) {
617
617
if (ENABLED (SDCARD_READONLY)) return false ;
618
618
619
619
const uint16_t crc = TERN (SD_CHECK_AND_RETRY, CRC_CCITT (src, 512 ), 0xFFFF );
0 commit comments