Attempt 2 (I do not know C)

This commit is contained in:
Lillian Skinner 2024-03-25 20:32:47 -04:00 committed by GitHub
parent 97e3b22a53
commit 6bcab4334c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,17 +173,13 @@ bool nandio_read_sectors(sec_t offset, sec_t len, void *buffer) {
} }
static bool write_sectors(sec_t start, sec_t len, const void *buffer) { static bool write_sectors(sec_t start, sec_t len, const void *buffer) {
activity(COLOR_RED);
dsi_nand_crypt(crypt_buf, buffer, start * SECTOR_SIZE / AES_BLOCK_SIZE, len * SECTOR_SIZE / AES_BLOCK_SIZE); dsi_nand_crypt(crypt_buf, buffer, start * SECTOR_SIZE / AES_BLOCK_SIZE, len * SECTOR_SIZE / AES_BLOCK_SIZE);
// if (fseek(f, start * SECTOR_SIZE, SEEK_SET) != 0) { // if (fseek(f, start * SECTOR_SIZE, SEEK_SET) != 0) {
// if (fwrite(crypt_buf, SECTOR_SIZE, len, f) == len) { // if (fwrite(crypt_buf, SECTOR_SIZE, len, f) == len) {
activity(COLOR_BRIGHT_RED);
if(nand_WriteSectors(start, len, crypt_buf)){ if(nand_WriteSectors(start, len, crypt_buf)){
activity(-1);
return true; return true;
} else { } else {
prt("NANDIO: write error\n"); //printf("NANDIO: write error\n");
activity(-1);
return false; return false;
} }
} }