more utility/debugging/info stuff

This commit is contained in:
Stefan `Sec` Zehl 2011-08-02 10:55:01 +02:00
parent 3c3d1032c5
commit 7eaa5f4e4b
1 changed files with 39 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include "basic/basic.h" #include "basic/basic.h"
#include "basic/config.h" #include "basic/config.h"
#include "lcd/render.h"
#include "lcd/print.h" #include "lcd/print.h"
#include "usb/usbmsc.h" #include "usb/usbmsc.h"
@ -40,7 +41,7 @@ void ChkBattery(void) {
lcdPrintln("0"); lcdPrintln("0");
}; };
lcdRefresh(); lcdRefresh();
delayms_queue(100); // delayms_queue(100);
} while ((getInputRaw())==BTN_NONE); } while ((getInputRaw())==BTN_NONE);
} }
@ -94,3 +95,40 @@ void uuid(void) {
lcdPrintln(IntToStrX(GetUUID32(),4)); lcdPrintln(IntToStrX(GetUUID32(),4));
lcdRefresh(); lcdRefresh();
} }
void Qstatus(void) {
int dx=0;
int dy=8;
lcdClear();
dx=DoString(0,dy+16,"Qdepth:");
while ((getInputRaw())!=BTN_ENTER){
DoInt(dx,dy+16,(the_queue.qend-the_queue.qstart+MAXQENTRIES)%MAXQENTRIES);
lcdDisplay();
if(getInputRaw()!=BTN_NONE)
work_queue();
else
delayms(10);
};
dy+=16;
dx=DoString(0,dy,"Done.");
};
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;
};