None
None
static const uint32_t LENGTH = 552;
int8_t *note;
static int8_t _note[LENGTH] __attribute__((section(".sdram")));
note = &_note[0];
FIL FileObject;
FRESULT err;
UINT bytes_read;
err = f_open(&FileObject, "0:/scalebank.tab", FA_READ | FA_OPEN_EXISTING);
if (err != FR_OK) {
report_fatfs_error(err, "0:/scalebank.tab");
return;
}
int rem_sz = sizeof(*note) * LENGTH;
int offset = 0;
while (rem_sz > 0) {
if (rem_sz > sizeof(fbuff)) {
err = f_read(&FileObject, fbuff, sizeof(fbuff), &bytes_read);
if (bytes_read == 0)
break;
memcpy((char *)(¬e[0]) + offset, (char *)fbuff, bytes_read);
rem_sz -= bytes_read;
offset += bytes_read;
} else {
err = f_read(&FileObject, fbuff, rem_sz, &bytes_read);
memcpy((char *)(¬e[0]) + offset, (char *)fbuff, bytes_read);
rem_sz = 0;
}
}
if (err != FR_OK) {
report_fatfs_error(err, "0:/scalebank.tab");
return;
};
err = f_close(&FileObject);
if (err != FR_OK) {
report_fatfs_error(err, "0:/scalebank.tab");
return;
};