Ejemplo n.º 1
0
int main(void)
{
	// Initialize ChibiOS
	halInit();
	chSysInit();

	// Initialize uGFX
	gfxInit();

	// Initialize our own stuff
	startupInit();

	// Get the command prompt (via USB) up and running
	cmdCreate();

	// Get the SD-Card stuff done
	sdcardInit();

	while (true) {
        cmdManage();
		if(SDU1.config->usbp->state == USB_ACTIVE){
			gwinShow(ghImageUSB);
		} else {
			gwinHide(ghImageUSB);
		}

		// Until the statusbar widget is ready...
		gwinSetVisible(ghImageSDC, sdcardReady());

        sdCardEvent();

		chThdSleepMilliseconds(500);
	}
}
Ejemplo n.º 2
0
int main()
{
    char cmd[256];
    char *token;

    printf ("Testing for T2FS - v 1.0\n");
    cmdMan();

    while (1) {
        printf ("T2FS> ");
        gets(cmd);
        if( (token = strtok(cmd," \t")) != NULL ) {
            if (strcmp(token,"exit")==0) { cmdExit(); break; }
            else if (strcmp(token,"man")==0) cmdMan();
            else if (strcmp(token,"who")==0) cmdWho();
            else if (strcmp(token,"cp")==0)  cmdCp();
            else if (strcmp(token,"fscp")==0) cmdFscp();
            else if (strcmp(token,"create")==0) cmdCreate();
            else if (strcmp(token,"del")==0) cmdDelete();
            else if (strcmp(token,"open")==0) cmdOpen();
            else if (strcmp(token,"close")==0) cmdClose();
            else if (strcmp(token,"read")==0) cmdRead();
            else if (strcmp(token,"mkdir")==0) cmdMkdir();
            else if (strcmp(token,"md")==0) cmdMkdir();
            else if (strcmp(token,"rmdir")==0) cmdRmdir();
            else if (strcmp(token,"rm")==0) cmdRmdir();
            else if (strcmp(token,"getcwd")==0) cmdGetcwd();
            else if (strcmp(token,"chdir")==0) cmdChdir();
            else if (strcmp(token,"cd")==0) cmdChdir();
            else if (strcmp(token,"ls")==0) cmdLs();
            else if (strcmp(token,"dir")==0) cmdLs();
            else printf ("???\n");
        }
    }

    return 0;
}