static const FLASH char * const FLASH rc_strings[] = {
- FSTR("OK"),
- FSTR("disk error"),
- FSTR("internal error"),
- FSTR("not ready"),
- FSTR("no file"),
- FSTR("no path"),
- FSTR("invalid name"),
- FSTR("denied"),
- FSTR("exist"),
- FSTR("invalid object"),
- FSTR("write protected"),
- FSTR("invalid drive"),
- FSTR("not enabled"),
- FSTR("no file system"),
- FSTR("mkfs aborted"),
- FSTR("timeout"),
- FSTR("locked"),
- FSTR("not enough core"),
- FSTR("too many open files"),
- FSTR("invalid parameter")
+ FSTR("Success"),
+ FSTR("Disk error"),
+ FSTR("Internal error"),
+ FSTR("Not ready"),
+ FSTR("No file"),
+ FSTR("No path"),
+ FSTR("Invalid name"),
+ FSTR("Denied"),
+ FSTR("Exist"),
+ FSTR("Invalid object"),
+ FSTR("Write protected"),
+ FSTR("Invalid drive"),
+ FSTR("Not enabled"),
+ FSTR("No file system"),
+ FSTR("Mkfs aborted"),
+ FSTR("Timeout"),
+ FSTR("Locked"),
+ FSTR("Not enough core"),
+ FSTR("Too many open files"),
+ FSTR("Invalid parameter")
};
static const FLASH char * const FLASH rc_names[] = {
}
-const FLASH char * rctostr(FRESULT rc)
+const FLASH char * fat_rctostr(FRESULT rc)
{
return rc < ARRAY_SIZE(rc_strings) ? rc_strings[rc] : PSTR(" Unknown Error");
}
static PATH_T *path_setup(char *string)
{
if (strlen(string) > PATH_MAX) {
- cmd_error(PSTR("'%s': name too long"), string);
+ cmd_error(0, 0, PSTR("'%s': Name too long"), string);
return NULL;
}
PATH_T *p = (PATH_T *) malloc(sizeof *p);
if (p == NULL) {
- cmd_error(PSTR("'%s': Out of Memory"), string);
+ cmd_error(0, 0, PSTR("'%s': Out of Memory"), string);
return NULL;
}
p->p_path[2] = '/';
len += 1;
} else {
- cmd_error(PSTR("'%s': Out of Memory"), string);
+ cmd_error(0, 0, PSTR("'%s': Out of Memory"), string);
return NULL;
}
}
}
free(buf);
if (res != FR_OK) {
- put_rc(res);
- return CMD_RET_FAILURE;
+ cmd_error(CMD_RET_FAILURE, res, NULL);
+ //put_rc(res);
+ //return CMD_RET_FAILURE;
}
return CMD_RET_SUCCESS;
}