2011-05-21 10:05:48 +00:00
|
|
|
#include <sysinit.h>
|
2011-06-13 21:39:21 +00:00
|
|
|
#include "basic/basic.h"
|
2011-05-21 10:05:48 +00:00
|
|
|
|
|
|
|
/**************************************************************************/
|
|
|
|
|
2011-06-20 21:33:42 +00:00
|
|
|
void main_default(void) {
|
2011-06-13 21:19:18 +00:00
|
|
|
systickInit(10);
|
2011-07-04 20:49:35 +00:00
|
|
|
|
|
|
|
if(getInputRaw()==BTN_ENTER){
|
|
|
|
ISPandReset(7);
|
|
|
|
};
|
|
|
|
|
2011-05-21 10:05:48 +00:00
|
|
|
return;
|
2011-06-13 21:19:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// every 10 ms
|
|
|
|
void tick_default(void) {
|
|
|
|
static int ctr;
|
|
|
|
ctr++;
|
|
|
|
if(ctr>100){
|
|
|
|
VoltageCheck();
|
|
|
|
ctr=0;
|
|
|
|
};
|
2011-06-13 21:39:21 +00:00
|
|
|
if(ctr%5==0){
|
|
|
|
if(GetVoltage()<3600){
|
|
|
|
IOCON_PIO1_11 = 0x0;
|
|
|
|
gpioSetDir(RB_LED3, gpioDirection_Output);
|
|
|
|
if( (ctr/5)%10 == 1 )
|
|
|
|
gpioSetValue (RB_LED3, 1);
|
|
|
|
else
|
|
|
|
gpioSetValue (RB_LED3, 0);
|
|
|
|
};
|
|
|
|
};
|
2011-06-13 21:19:18 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
};
|