Ejemplo n.º 1
0
//# MENU SD_USB
void menu_sdcard(void){
    lcdClear();

    sdmmc_setup();
    uint32_t r = sdmmc_acquire();

    if(r) {
        lcdPrintln("SD card found.");
        lcdPrintln("No. of blocks:");
        lcdPrintln(IntToStr(Chip_SDMMC_GetDeviceBlocks(LPC_SDMMC), 10, 0));
        lcdPrintln("in USB MSC mode");
        // SD I/O needs higher interrupt prio than USB so it works within
        // the USB callbacks
        NVIC_SetPriority(USB0_IRQn, 2);
        NVIC_SetPriority(SDIO_IRQn, 0);
        SD_MSCenable();
    } else {
        lcdPrintln("No SD card found.");
    }
    lcdDisplay();
    while(getInputRaw()==BTN_NONE){
        /* wait */
        __asm__ volatile ("nop");
    };

    lcdPrintln("goodbye!");
    lcdDisplay();
    MSCdisable();
    Chip_SDIF_DeInit(LPC_SDMMC);
}
Ejemplo n.º 2
0
void full_msc() {
    MSCenable();
    lcdPrintln("MSC enabled.");
    lcdDisplay();
    while(getInputRaw()!=BTN_ENTER) {
        __WFI();
    };
    lcdPrintln("MSC disabled");
    lcdDisplay();
    MSCdisable();
};
Ejemplo n.º 3
0
void msc_menu(void){
    MSCenable();
    lcdPrintln("MSC enabled.");
    lcdDisplay();
    getInputWaitRelease();
    getInputWait();
    lcdPrintln("disconnect");
    lcdDisplay();
    MSCdisable();
    fsReInit();
    getInputWaitRelease();
}
Ejemplo n.º 4
0
//# MENU MSC
void msc_menu(){
	MSCenable();
	lcdPrintln("MSC enabled.");
	getInputWaitRelease();
	while(getInputRaw()!=BTN_ENTER){
		if(getInputRaw()==BTN_RIGHT)
			lcdPrintln(".");
		lcdDisplay();
		__WFI();
	};
	lcdPrintln("disconnect");
	lcdDisplay();
	MSCdisable();
	fsReInit();
	getInputWaitRelease();
};
Ejemplo n.º 5
0
void full_msc(){
	MSCenable();
	lcdPrintln("FLASHMSC enabled.");
	lcdNl();
	lcdNl();
	lcdDisplay();
	while(getInputRaw()!=BTN_ENTER){
        uint32_t min = mscDisk_minAddressWR();
        uint32_t max = mscDisk_maxAddressWR();
        lcdMoveCrsr(0,-16);
        lcdPrint("MIN:");
        lcdPrintln(IntToStr(min,8,F_SSPACE));
        lcdPrint("MAX:");
        lcdPrintln(IntToStr(max,8,F_SSPACE));
        lcdDisplay();
        if(min == 0 && max == 2097151) {
            break;
        }
	};
	lcdPrintln("FLASHMSC disabled");
	lcdDisplay();
	MSCdisable();
};
Ejemplo n.º 6
0
void doMSC(){
	MSCenable();
	lcdPrintln("MSC enabled.");
	lcdDisplay();
	getInputWaitRelease();

	while(getInputRaw()!=BTN_ENTER){
        uint32_t max = mscDisk_maxAddressWR();
        lcdPrint("MAX:");
        lcdPrintln(IntToStr(max,8,F_SSPACE));
        lcdDisplay();
        lcdMoveCrsr(0,-8);
        if(max == 1572863) {
            break;
        }
		//__WFI();
	};

	lcdPrintln("disconnect");
	lcdDisplay();
	MSCdisable();
	fsReInit();
	getInputWaitRelease();
};