Merge branch 'master' into secperiments

This commit is contained in:
Stefan `Sec` Zehl 2011-05-22 17:52:15 +02:00
commit 0a7920c13f
4 changed files with 25 additions and 8 deletions

View File

@ -10,7 +10,7 @@ OBJS +=
OBJS += basic/basic.o
OBJS += eeprom/eeprom.o
OBJS += reinvoke_isp.o
LIBS += core/libcore.a lcd/libfont.a modules/libmodules.a
LIBS += core/libcore.a lcd/liblcd.a modules/libmodules.a
##########################################################################
# GNU GCC compiler flags
@ -29,7 +29,7 @@ OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o
LDLIBS = -lm
LDLIBS += -Lmodules -lmodules
LDLIBS += -Lcore -lcore
LDLIBS += -Llcd -lfont
LDLIBS += -Llcd -llcd
OCFLAGS = --strip-unneeded
LD_PATH = lpc1xxx
@ -44,7 +44,7 @@ all: firmware
core/libcore.a: core/projectconfig.h
cd core && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
lcd/libfont.a lcd/render.o lcd/display.o:
lcd/liblcd.a lcd/render.o lcd/display.o:
cd lcd && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
modules/libmodules.a:
@ -76,5 +76,5 @@ clean:
@cd modules && $(MAKE) clean
.PHONY: lcd/libfont.a modules/libmodules.a
.PHONY: lcd/liblcd.a modules/libmodules.a

View File

@ -30,6 +30,7 @@ void delayms(uint32_t ms)
/**************************************************************************/
uint8_t lcdBuffer[RESX*RESY_B];
int inverted = 0;
/*
//TODO FIXME why doenst that work ?
@ -160,7 +161,16 @@ void lcdDisplay(uint32_t shift)
uint16_t i,page;
for(page=0; page<RESY_B;page++) {
for(i=0; i<RESX; i++) {
lcdWrite(1,lcdBuffer[page*RESX+((i+shift)%RESX)]);
if (inverted) {
lcdWrite(1,~lcdBuffer[page*RESX+((i+shift)%RESX)]);
} else {
lcdWrite(1,lcdBuffer[page*RESX+((i+shift)%RESX)]);
}
}
}
}
void lcdInvert(void) {
inverted = ~inverted;
}

View File

@ -22,5 +22,6 @@ void lcdRead(uint8_t data);
void lcdInit(void);
void lcdFill(char f);
void lcdDisplay(uint32_t shift);
void lcdInvert(void);
#endif

View File

@ -32,20 +32,25 @@ void module_bsx(void) {
brightness++;
if (brightness > 100) brightness = 100;
backlightSetBrightness(brightness);
};
}
if(gpioGetValue(RB_BTN0)==0){
brightness--;
if (brightness > 100) brightness = 0;
backlightSetBrightness(brightness);
};
}
if (gpioGetValue(RB_BTN3) == 0) {
while(gpioGetValue(RB_BTN3)==0);
lcdInvert();
}
if (gpioGetValue(RB_BTN4)==0) {
while(gpioGetValue(RB_BTN4)==0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ReinvokeISP();
};
}
dx = DoString(0, yctr, "Bright:");
dx = DoInt(dx, yctr, brightness);
@ -72,3 +77,4 @@ void module_bsx(void) {
return;
}