None
None
bool32.tgl confirm1
bool32.mom confirm2
bool32 busy
bool32 succeeded
bool32 failed
FRESULT fs_error = FR_OK;
bool pconfirm;
bool busy;
bool ready;
msg_t ThreadX2() {
busy = 1;
fs_error = f_mkfs(0, 0, 0);
if (fs_error != FR_OK)
report_fatfs_error(fs_error, "");
sdcard_unmount();
sdcard_attemptMountIfUnmounted();
ready = 1;
chThdExit((msg_t)0);
}
static msg_t ThreadX(void *arg) { ((attr_parent *)arg)->ThreadX2(); }
WORKING_AREA(waThreadX, 1024);
Thread *pThd = 0;
if (param_confirm1 && param_confirm2 && !pconfirm) {
pconfirm = 1;
pThd = chThdCreateStatic(waThreadX, sizeof(waThreadX), NORMALPRIO, ThreadX,
(void *)this);
} else if (!param_confirm2) {
pconfirm = 0;
}
if (ready) {
busy = 0;
pThd = 0;
}
disp_busy = busy;
disp_succeeded = ready && (fs_error == FR_OK);
disp_failed = ready && (fs_error != FR_OK);