added position leds

This commit is contained in:
schneider 2011-08-05 23:33:31 +02:00
parent 97d33bf402
commit e9d6de9f2c
3 changed files with 26 additions and 6 deletions

View File

@ -24,7 +24,7 @@ void main_default(void) {
switch(getInputRaw()){ switch(getInputRaw()){
case BTN_ENTER: case BTN_ENTER:
lcdPrint("ISP activated"); lcdPrint("ISP active");
lcdRefresh(); lcdRefresh();
ReinvokeISP(); ReinvokeISP();
break; break;
@ -33,8 +33,8 @@ void main_default(void) {
break; break;
case BTN_DOWN: case BTN_DOWN:
usbMSCInit(); usbMSCInit();
while(1) while(1);
delayms_power(100); //delayms_power(100);
break; break;
}; };
@ -50,10 +50,10 @@ void main_default(void) {
void queue_setinvert(void){ static void queue_setinvert(void){
lcdSetInvert(1); lcdSetInvert(1);
}; };
void queue_unsetinvert(void){ static void queue_unsetinvert(void){
lcdSetInvert(0); lcdSetInvert(0);
}; };
@ -75,7 +75,25 @@ void tick_default(void) {
}; };
static char night=0; static char night=0;
static char posleds = 0;
EVERY(128,2){ EVERY(128,2){
if( isNight() ){
if( GLOBAL(positionleds) ){
gpioSetValue (RB_LED0, 1);
gpioSetValue (RB_LED2, 1);
posleds = 1;
}else if( posleds = 1 ){
gpioSetValue (RB_LED0, 0);
gpioSetValue (RB_LED2, 0);
}
}else{
if( posleds ){
posleds = 0;
gpioSetValue (RB_LED0, 0);
gpioSetValue (RB_LED2, 0);
}
}
if(night!=isNight()){ if(night!=isNight()){
night=isNight(); night=isNight();
if(night){ if(night){
@ -84,7 +102,7 @@ void tick_default(void) {
}else{ }else{
backlightSetBrightness(0); backlightSetBrightness(0);
push_queue(queue_setinvert); push_queue(queue_setinvert);
}; };
}; };
}; };

View File

@ -29,6 +29,7 @@ struct CDESC the_config[]= {
{"flameminw", 0x8f, 1, 255, 1, CFG_TYPE_FLAME}, {"flameminw", 0x8f, 1, 255, 1, CFG_TYPE_FLAME},
{"l0nick", 0, 0, 1 , 0, 0}, {"l0nick", 0, 0, 1 , 0, 0},
{"chargeled", 0, 0, 1 , 0, 0}, {"chargeled", 0, 0, 1 , 0, 0},
{"positionleds", 1, 0, 1 , 0, 0},
{ NULL, 0, 0, 0 , 0, 0}, { NULL, 0, 0, 0 , 0, 0},
}; };

View File

@ -43,6 +43,7 @@ extern char nickl0[];
#define GLOBALflameminw (the_config[15].value) #define GLOBALflameminw (the_config[15].value)
#define GLOBALl0nick (the_config[16].value) #define GLOBALl0nick (the_config[16].value)
#define GLOBALchargeled (the_config[17].value) #define GLOBALchargeled (the_config[17].value)
#define GLOBALpositionleds (the_config[18].value)
#define GLOBALnickname (nickname) #define GLOBALnickname (nickname)
#define GLOBALnickfont (nickfont) #define GLOBALnickfont (nickfont)
#define GLOBALnickl0 (nickl0) #define GLOBALnickl0 (nickl0)