Skip to content

Instantly share code, notes, and snippets.

@boochow
Created May 11, 2018 23:51
Show Gist options
  • Save boochow/030bf5259414fb0e305491a3d2570242 to your computer and use it in GitHub Desktop.
Save boochow/030bf5259414fb0e305491a3d2570242 to your computer and use it in GitHub Desktop.
if (sd_init() == SD_OK) {
unsigned char buf[1024];
if (sd_readblock(0, buf, 1)) {
for (int i = 0; i < 512; i++) {
if (i % 16 == 0) {
printf("%04x:", i);
}
printf("%02x ", buf[i]);
if ((i + 1) % 16 == 0) {
printf("\n\r");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment