예제 #1
0
파일: sdcard.c 프로젝트: n0p/f1rmware
//# 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);
}
예제 #2
0
파일: main.c 프로젝트: miloh/f1rmware
void full_msc() {
    MSCenable();
    lcdPrintln("MSC enabled.");
    lcdDisplay();
    while(getInputRaw()!=BTN_ENTER) {
        __WFI();
    };
    lcdPrintln("MSC disabled");
    lcdDisplay();
    MSCdisable();
};
예제 #3
0
파일: util.c 프로젝트: cokesme/f1rmware
void msc_menu(void){
    MSCenable();
    lcdPrintln("MSC enabled.");
    lcdDisplay();
    getInputWaitRelease();
    getInputWait();
    lcdPrintln("disconnect");
    lcdDisplay();
    MSCdisable();
    fsReInit();
    getInputWaitRelease();
}
예제 #4
0
파일: msc.c 프로젝트: cokesme/f1rmware
//# 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();
};
예제 #5
0
파일: main.c 프로젝트: neosam/f1rmware
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();
};
예제 #6
0
파일: main.c 프로젝트: ravench/f1rmware
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();
};