Exemplo n.º 1
0
static uint8_t PrintStatus(const CLS1_StdIOType *io) {
	uffs_MountTable *m;
	MSGLN("UFFS defined mount points:");
	m = get_flash_mount_table();
	while (m->dev)
	{
		MSGLN("Mount point: %s, start: %d, end: %d",
				m->mount, m->start_block, m->end_block);
		m++;
	}
	MSGLN("mounted list:");
	m = uffs_MtbGetMounted();
	while (m)
	{
		MSGLN("Mount point: %s, start: %d, end: %d",
				m->mount, m->start_block, m->end_block);
		m = m->next;
	}
	MSGLN("unmounted list:");
	m = uffs_MtbGetUnMounted();
	while (m)
	{
		MSGLN("Mount point: %s, start: %d, end: %d",
				m->mount, m->start_block, m->end_block);
		//m->next;
	}

	return ERR_OK;
}
/** mount partition or show mounted partitions
 *		mount [<mount>]
 */
static int cmd_mount(int argc, char *argv[])
{
	uffs_MountTable *tab;
	const char *mount = NULL;

	if (argc == 1) {
		tab = uffs_MtbGetMounted();
		while (tab) {
			MSG(" %s : (%d) ~ (%d)\n", tab->mount, tab->start_block, tab->end_block);
			tab = tab->next;
		}
	}
	else {
		mount = argv[1];
		if (uffs_Mount(mount) < 0) {
			MSGLN("Can't mount %s", mount);
			return -1;
		}
	}
	return 0;
}