Skip to content

Commit

Permalink
replaced numbers with appropriate Macros for SD block size.
Browse files Browse the repository at this point in the history
  • Loading branch information
avtoku committed Sep 4, 2024
1 parent ed343c0 commit c5f3d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/drivers/Sd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool Sd::read(uint8_t * dest, size_t len)
}
bool Sd::write(uint8_t * src, size_t len)
{
uint16_t Nblocks = (len + 511) / 512;
uint16_t Nblocks = (len + SD_BLKSIZE - 1) / SD_BLKSIZE;
// printf("Nblocks = %u\n",Nblocks);
// if(Nblocks > sd_info.BlockNbr) Nblocks = sd_info.BlockNbr;
if (Nblocks > SD_MAXBLKS) return 0; // too large and don't want to be here forever, throw an error
Expand Down

0 comments on commit c5f3d25

Please sign in to comment.