Пример #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;
}
/** unmount parition or show unmounted partitions
 *		umount [<mount>]
 */
static int cmd_unmount(int argc, char *argv[])
{
	uffs_MountTable *tab;
	const char *mount = NULL;

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

	return 0;
}