diff --git a/firmware/applications/default.c b/firmware/applications/default.c index 5f3826f..f104b0b 100644 --- a/firmware/applications/default.c +++ b/firmware/applications/default.c @@ -1,8 +1,68 @@ #include #include "basic/basic.h" +#include "lcd/lcd.h" +#include "lcd/print.h" +#include "filesystem/ff.h" +#include "usb/usbmsc.h" + /**************************************************************************/ +FATFS FatFs[_VOLUMES]; /* File system object for logical drive */ + +#define CONFIGLEN 2 +int lcdInitConfig(){ + FIL file[2]; /* File objects */ + BYTE buf[CONFIGLEN]; + UINT readbytes; + int res; + + lcdFill(0); // clear display buffer + res=f_mount(0, &FatFs[0]); + lcdPrint("mount:"); + lcdPrintln(f_get_rc_string(res)); + if(res){ + return 1; + }; + + res=f_open(&file[0], "r0ket.cfg", FA_OPEN_EXISTING|FA_READ); + lcdPrint("open:"); + lcdPrintln(f_get_rc_string(res)); + if(res){ + lcdPrintln("r0ket.cfg missing!"); + return 1; + }; + + for(int i=0;i