2011-08-02 00:10:15 +00:00
|
|
|
#include <sysinit.h>
|
2011-08-02 00:45:25 +00:00
|
|
|
#include <string.h>
|
2011-08-02 00:10:15 +00:00
|
|
|
|
|
|
|
#include "basic/basic.h"
|
|
|
|
#include "basic/config.h"
|
|
|
|
|
2011-08-02 08:55:01 +00:00
|
|
|
#include "lcd/render.h"
|
2011-08-02 00:10:15 +00:00
|
|
|
#include "lcd/print.h"
|
2011-08-04 23:58:44 +00:00
|
|
|
#include "lcd/image.h"
|
2011-08-02 00:10:15 +00:00
|
|
|
|
|
|
|
#include "usb/usbmsc.h"
|
|
|
|
|
2011-08-04 23:58:44 +00:00
|
|
|
#include "filesystem/ff.h"
|
|
|
|
#include "filesystem/select.h"
|
|
|
|
|
2011-08-02 00:45:25 +00:00
|
|
|
#include "core/iap/iap.h"
|
2011-08-02 00:10:15 +00:00
|
|
|
|
|
|
|
/**************************************************************************/
|
|
|
|
|
2011-08-04 23:58:44 +00:00
|
|
|
//# MENU usb_storage
|
2011-08-02 19:21:58 +00:00
|
|
|
void msc_menu(void){
|
|
|
|
lcdClear();
|
|
|
|
lcdPrintln("MSC Enabled.");
|
|
|
|
lcdRefresh();
|
|
|
|
usbMSCInit();
|
2011-08-21 16:45:23 +00:00
|
|
|
while(!getInputRaw())delayms(10);
|
2011-08-02 19:21:58 +00:00
|
|
|
DoString(0,16,"MSC Disabled.");
|
|
|
|
usbMSCOff();
|
|
|
|
fsReInit();
|
|
|
|
};
|
|
|
|
|
2011-08-21 23:22:35 +00:00
|
|
|
//# MENU lcdread
|
|
|
|
void lcdrtest(void){
|
|
|
|
lcdClear();
|
|
|
|
lcdPrint("ID1:"); lcdPrintInt(lcdRead(128+64+16+8 +2 )); lcdNl();
|
|
|
|
lcdPrint("ID2:"); lcdPrintInt(lcdRead(128+64+16+8 +2+1)); lcdNl();
|
|
|
|
lcdPrint("ID3:"); lcdPrintInt(lcdRead(128+64+16+8+4 )); lcdNl();
|
|
|
|
lcdPrint("ID4:"); lcdPrintInt(lcdRead(128+64+16+8+4 +1)); lcdNl();
|
|
|
|
lcdPrint("Tmp:"); lcdPrintInt(lcdRead(128+64+16+8+4+2 )); lcdNl();
|
|
|
|
lcdPrint("VM:"); lcdPrintInt(lcdRead(128+64+16+8+4+2+1)); lcdNl();
|
|
|
|
// lcd_select(); mylcdWrite(0,128+32+8+4+1); lcd_deselect();
|
|
|
|
delayms(10);
|
|
|
|
lcdInit();
|
|
|
|
lcdRefresh();
|
|
|
|
while(!getInputRaw())delayms(10);
|
|
|
|
};
|
|
|
|
|
2011-08-04 12:33:39 +00:00
|
|
|
void blink_led0(void){
|
|
|
|
gpioSetValue (RB_LED0, 1-gpioGetValue(RB_LED0));
|
|
|
|
};
|
|
|
|
|
|
|
|
void tick_alive(void){
|
|
|
|
static int foo=0;
|
|
|
|
|
|
|
|
if(GLOBAL(alivechk)==0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(foo++>500/SYSTICKSPEED){
|
|
|
|
foo=0;
|
|
|
|
if(GLOBAL(alivechk)==2)
|
|
|
|
push_queue(blink_led0);
|
|
|
|
else
|
|
|
|
blink_led0();
|
|
|
|
};
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
2011-08-04 23:58:44 +00:00
|
|
|
|
|
|
|
// //# MENU img img
|
|
|
|
void t_img(void){
|
|
|
|
char fname[FILENAMELEN];
|
|
|
|
selectFile(fname, "LCD");
|
|
|
|
lcdLoadImage(fname);
|
|
|
|
lcdRefresh();
|
|
|
|
getInputWait();
|
|
|
|
};
|
|
|
|
|
|
|
|
// //# MENU img anim
|
|
|
|
void t_ani(void){
|
|
|
|
char fname[FILENAMELEN];
|
|
|
|
selectFile(fname, "LCD");
|
|
|
|
lcdShowAnim(fname,1000);
|
|
|
|
};
|