Remove argument from lcdDisplay() and ISPandReset()

This commit is contained in:
Stefan `Sec` Zehl 2011-07-18 22:09:31 +02:00
parent c39052259d
commit f4dee3550c
30 changed files with 84 additions and 88 deletions

View File

@ -25,7 +25,7 @@ void main_adc(void) {
while (1) {
uint32_t results;
lcdDisplay(0);
lcdDisplay();
delayms(10);
if(gpioGetValue(RB_BTN1)==0){
@ -48,7 +48,7 @@ void main_adc(void) {
if (gpioGetValue(RB_BTN4)==0) {
while(gpioGetValue(RB_BTN4)==0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
lcdDisplay();
EnableWatchdog(1000*5);
ReinvokeISP();

View File

@ -21,19 +21,19 @@ void main_bsx(void) {
font = &Font_7x8;
DoString(0, 0, "bsx");
lcdDisplay(0);
lcdDisplay();
delayms(1000);
usbMSCInit();
while (1) {
uint32_t results;
lcdDisplay(0);
lcdDisplay();
delayms(10);
if (gpioGetValue(RB_BTN4)==0) {
while(gpioGetValue(RB_BTN4)==0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
lcdDisplay();
ReinvokeISP();
}
}

View File

@ -68,7 +68,7 @@ void main_cdc(void)
CDC_RdOutBuf (buf, &l);
puts(buf);
dx=DoString(dx,0,buf);
lcdDisplay(0);
lcdDisplay();
}
//puts("hello world\r\n");
//delayms(1);

View File

@ -94,15 +94,15 @@ void main_default(void) {
systickInit(10);
if(getInputRaw()==BTN_ENTER){
ISPandReset(7);
ISPandReset();
};
font=&Font_7x8;
if(lcdInitConfig()){
lcdDisplay(0);
lcdDisplay();
getInputWait();
}else{
lcdDisplay(0);
lcdDisplay();
delayms(300);
};

View File

@ -20,7 +20,7 @@ void execute_menu(void){
void msc_menu(void){
DoString(0,8,"MSC Enabled.");
lcdDisplay(0);
lcdDisplay();
usbMSCInit();
while(!getInputRaw())delayms(10);
DoString(0,16,"MSC Disabled.");
@ -29,8 +29,8 @@ void msc_menu(void){
void gotoISP(void) {
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
void lcd_mirror(void) {
@ -44,7 +44,7 @@ void adc_check(void) {
dx=DoString(0,dy,"Voltage:");
while ((getInputRaw())==BTN_NONE){
DoInt(dx,dy,GetVoltage());
lcdDisplay(0);
lcdDisplay();
};
dy+=8;
dx=DoString(0,dy,"Done.");
@ -77,7 +77,7 @@ void main_exe(void) {
while (1) {
lcdFill(0); // clear display buffer
lcdDisplay(0);
lcdDisplay();
handleMenu(&mainmenu);
gotoISP();
}

View File

@ -17,7 +17,7 @@ void execute (const void *function, uint16_t length){
DoString(0,8,"Enter RAM!");
DoIntX(0,16,(uint32_t)function);
DoIntX(0,24,(uint32_t)dst);
lcdDisplay(0);
lcdDisplay();
for(int i=0;i<length;i++){
((char*)dst)[i]=((char*)function)[i];
@ -69,7 +69,7 @@ void execute_file (const char * fname){
int dx;
dx=DoString(0,16,"read: ");
DoInt(dx,16,readbytes);
lcdDisplay(0);
lcdDisplay();
dst=(void (*)(void)) ((uint32_t)(dst) | 1); // Enable Thumb mode!
dst();
@ -101,7 +101,7 @@ void main_executor(void) {
while (1) {
ctr++;
lcdDisplay(0);
lcdDisplay();
delayms(10);
key= getInput();
@ -119,21 +119,21 @@ void main_executor(void) {
// Easy flashing
if(key==BTN_LEFT){
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
};
// DF xecute
if(key==BTN_RIGHT){
DoString(0,0,"Enter RAM!");
lcdDisplay(0);
lcdDisplay();
while(getInput()!=BTN_NONE);
FATFS FatFs; /* File system object for logical drive */
put_rc(f_mount(0, &FatFs));
execute_file("0:test.c0d");
lcdDisplay(0);
lcdDisplay();
while(!getInput());
};

View File

@ -109,7 +109,7 @@ void f_nick(void){
lcdPrint("x");
lcdPrintInt(y);
lcdDisplay(0);
lcdDisplay();
delayms(40);
key= getInputRaw();
@ -124,7 +124,7 @@ void f_nick(void){
}else if (key ==BTN_ENTER){
lcdClear();
lcdPrintln("Done.");
lcdDisplay(0);
lcdDisplay();
ctr++;
break;
};
@ -135,8 +135,8 @@ void f_nick(void){
void gotoISP(void) {
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
void lcd_mirror(void) {
@ -154,7 +154,7 @@ void adc_check(void) {
dx=DoString(0,dy,"Voltage:");
while ((getInputRaw())==BTN_NONE){
DoInt(dx,dy,GetVoltage());
lcdDisplay(0);
lcdDisplay();
};
dy+=8;
dx=DoString(0,dy,"Done.");
@ -162,7 +162,7 @@ void adc_check(void) {
void msc_menu(void){
DoString(0,8,"MSC Enabled.");
lcdDisplay(0);
lcdDisplay();
usbMSCInit();
while(!getInputRaw())delayms(10);
DoString(0,16,"MSC Disabled.");
@ -205,7 +205,7 @@ void main_font(void) {
while (1) {
lcdFill(0); // clear display buffer
lcdDisplay(0);
lcdDisplay();
handleMenu(&mainmenu);
gotoISP();
}

View File

@ -69,7 +69,7 @@ void main_fs(void) {
font_direction = FONT_DIR_LTR; // LeftToRight is the default
while (1) {
lcdDisplay(0);
lcdDisplay();
delayms(10);
lcdFill(0); // clear display buffer
@ -109,8 +109,8 @@ void tick_fs(void){
void gotoISP(void) {
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
void put_rc_y (FRESULT rc, int y) {

View File

@ -163,8 +163,8 @@ void f_send(void){
void gotoISP(void) {
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
void lcd_mirror(void) {
@ -178,7 +178,7 @@ void adc_check(void) {
dx=DoString(0,dy,"Voltage:");
while ((getInputRaw())==BTN_NONE){
DoInt(dx,dy,GetVoltage());
lcdDisplay(0);
lcdDisplay();
};
dy+=8;
dx=DoString(0,dy,"Done.");
@ -230,7 +230,7 @@ void main_funk(void) {
openbeaconSetup(0x5ec);
while (1) {
lcdFill(0); // clear display buffer
lcdDisplay(0);
lcdDisplay();
handleMenu(&mainmenu);
gotoISP();
}

View File

@ -57,7 +57,7 @@ void main_iggy(void) {
while (1) {
ctr++;
uint32_t results;
lcdDisplay(j);
lcdDisplay();
delayms(10);
font=fonts[fontctr];
@ -85,7 +85,7 @@ void main_iggy(void) {
if(gpioGetValue(RB_BTN0)==0){
while(gpioGetValue(RB_BTN0)==0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
lcdDisplay();
EnableWatchdog(1000*5);
ReinvokeISP();
};
@ -99,7 +99,7 @@ void main_iggy(void) {
//on = ~on;
//lcdSetPixel(20,20,true);
//lcdDisplay(0);
//lcdDisplay();
//lcdSetPixel(20,21,0);
//lcdSetPixel(21,20,1);

View File

@ -29,11 +29,11 @@ void main_lilafisch(void) {
lcdToggleFlag(LCD_MIRRORX);
backlightInit();
font_direction = FONT_DIR_LTR; // LeftToRight is the default
dx=DoString(0,0,"init timer"); lcdDisplay(0);
dx=DoString(0,0,"init timer"); lcdDisplay();
timer32Init(0, (72E6/5E3)/2); //timer einschalten, auf 5kHz(?) setzen
dx=DoString(0,0,"enable timer"); lcdDisplay(0);
dx=DoString(0,0,"enable timer"); lcdDisplay();
timer32Enable(0);
dx=DoString(0,0,"timer done"); lcdDisplay(0);
dx=DoString(0,0,"timer done"); lcdDisplay();
while (1) {
ton ++;
@ -46,7 +46,7 @@ void main_lilafisch(void) {
if (TMR_TMR32B0TC > timer){ //schneller fix wenn ton zurueckgesetzt wird, aber timer weiterlaeuft
TMR_TMR32B0TC=0;
}
lcdDisplay(0);
lcdDisplay();
delayms(10);
key= getInput();
@ -56,8 +56,8 @@ void main_lilafisch(void) {
if(key==BTN_LEFT){
timer32Disable(0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
//font = &Font_Ubuntu36pt;

View File

@ -113,7 +113,7 @@ void cross(char x, char y) {
lcdSetPixel(x-2,y,false);
lcdSetPixel(x,y+2,false);
lcdSetPixel(x,y-2,false);
lcdDisplay(0);
lcdDisplay();
}
void blink(){
@ -139,7 +139,7 @@ void main_mandelbrot(void) {
mandelMove();
if (mandel.dirty) mandelCalc();
lcdDisplay(0);
lcdDisplay();
//TODO fix this
if (!autozoom) {

View File

@ -106,7 +106,7 @@ void main_mandelbrot2(void) {
font=&Font_7x8;
mandelInit();
while (1) {
lcdDisplay(0);
lcdDisplay();
mandelMove();
if (mandel.dirty) {
mandelCalc();
@ -114,8 +114,8 @@ void main_mandelbrot2(void) {
if(gpioGetValue(RB_BTN0)==0 && gpioGetValue(RB_BTN4)==0){
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
}

View File

@ -58,7 +58,7 @@ void main_menutest(void) {
font_direction = FONT_DIR_LTR; // LeftToRight is the default
while (1) {
lcdDisplay(0);
lcdDisplay();
delayms(10);
lcdFill(0); // clear display buffer
@ -91,7 +91,7 @@ void decBacklight(void) {
void gotoISP(void) {
DoString(0,58,"Enter ISP!");
lcdDisplay(0);
lcdDisplay();
EnableWatchdog(5000);
ReinvokeISP();
}

View File

@ -16,7 +16,7 @@ void main_minimal(void) {
font_direction = FONT_DIR_LTR; // LeftToRight is the default
while (1) {
lcdDisplay(0);
lcdDisplay();
delayms(10);
key= getInput();
@ -25,8 +25,8 @@ void main_minimal(void) {
// Easy flashing
if(key==BTN_LEFT){
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
//font = &Font_Ubuntu36pt;

View File

@ -59,7 +59,7 @@ void f_recv(void){
lcdPrint("ct:");lcdPrintIntHex( *(int*)(buf+ 4) ); lcdNl();
lcdPrint("id:");lcdPrintIntHex( *(int*)(buf+ 8) ); lcdNl();
lcdPrint("xx:");lcdPrintIntHex( *(int*)(buf+12) ); lcdNl();
lcdDisplay(0);
lcdDisplay();
};
};
@ -101,7 +101,7 @@ void f_send(void){
lcdPrint("F-St:"); lcdPrintInt(status);
if(buf[2]==BTN_ENTER)
break;
lcdDisplay(0);
lcdDisplay();
len=nrf_rcv_pkt_time_encr(10,sizeof(buf),buf,testkey);
if(len>0){
lcdPrint("Got!");
@ -113,8 +113,8 @@ void f_send(void){
void gotoISP(void) {
DoString(0,0,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}
void lcd_mirror(void) {
@ -128,7 +128,7 @@ void adc_check(void) {
dx=DoString(0,dy,"Voltage:");
while ((getInputRaw())==BTN_NONE){
DoInt(dx,dy,GetVoltage());
lcdDisplay(0);
lcdDisplay();
};
dy+=8;
dx=DoString(0,dy,"Done.");
@ -136,7 +136,7 @@ void adc_check(void) {
void msc_menu(void){
DoString(0,8,"MSC Enabled.");
lcdDisplay(0);
lcdDisplay();
usbMSCInit();
while(!getInputRaw())delayms(10);
DoString(0,16,"MSC Disabled.");
@ -177,7 +177,7 @@ void main_remote(void) {
while (1) {
lcdFill(0); // clear display buffer
lcdDisplay(0);
lcdDisplay();
handleMenu(&mainmenu);
gotoISP();
}

View File

@ -56,7 +56,7 @@ void main_s(void) {
while (1) {
ctr++;
uint32_t results;
lcdDisplay(j);
lcdDisplay();
delayms(10);
font=fonts[fontctr];
@ -76,7 +76,7 @@ void main_s(void) {
if(gpioGetValue(RB_BTN0)==0){
while(gpioGetValue(RB_BTN0)==0);
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
lcdDisplay();
EnableWatchdog(1000*5);
ReinvokeISP();
};

View File

@ -34,15 +34,15 @@ void main_schneider(void) {
// Easy flashing
if(key==BTN_LEFT){
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
};
// Display nickname
//font = &Font_Ubuntu36pt;
dx=DoString(0,0,"Test");
dx=DoInt(dx,0,ctr++);
lcdDisplay(0);
lcdDisplay();
encryption_decryption_demo("This is encrypted",
"1c56d302cf642a8e1ba4b48cc4fbe2845ee32dce7",
"45f46eb303edf2e62f74bd68368d979e265ee3c03",

View File

@ -30,7 +30,7 @@ void main_sec(void) {
while (1) {
ctr++;
lcdDisplay(0);
lcdDisplay();
delayms(10);
key= getInput();
@ -48,8 +48,8 @@ void main_sec(void) {
// Easy flashing
if(key==BTN_LEFT){
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
};
// Display nickname

View File

@ -222,7 +222,7 @@ void main_spaceinvaders(void) {
draw_enemy();
draw_shot();
draw_status();
lcdDisplay(0);
lcdDisplay();
delayms(10);
}
return;

View File

@ -311,8 +311,8 @@ void main_vcard(void) {
// Easy flashing
if(key==BTN_LEFT){
DoString(0,8,"Enter ISP!");
lcdDisplay(0);
ISPandReset(5);
lcdDisplay();
ISPandReset();
}else if(key==BTN_UP){
//lcdClear();
//lcdPrintln("Generating...");

View File

@ -126,7 +126,7 @@ void rbInit(void);
// reinvoke_isp.c
void ReinvokeISP(void);
void EnableWatchdog(uint32_t ms);
void ISPandReset(int delay);
void ISPandReset(void);
// delayms.c
void delayms(uint32_t ms);

View File

@ -29,10 +29,6 @@ uint8_t getInput(void) {
result += BTN_RIGHT;
}
if (result == (BTN_LEFT+BTN_UP+BTN_ENTER)){ /* Development hack */
ISPandReset(5);
}
return result;
}

View File

@ -41,7 +41,7 @@ void handleMenu(const struct MENU *the_menu) {
}
line += font->u8Height;
}
lcdDisplay(0);
lcdDisplay();
switch (getInput()) {
case BTN_UP:
@ -78,7 +78,7 @@ void handleMenu(const struct MENU *the_menu) {
lcdRefresh();
if (the_menu->entries[menuselection]->callback!=NULL)
the_menu->entries[menuselection]->callback();
lcdDisplay(0);
lcdDisplay();
getInputWait();
break;

View File

@ -74,14 +74,14 @@ void EnableWatchdog(uint32_t ms){
WDT_WDFEED = WDT_WDFEED_FEED2;
};
void ISPandReset(int delay){
void ISPandReset(void){
#if CFG_USBMSC
if(usbMSCenabled){
usbMSCOff();
delayms(500);
};
#endif
EnableWatchdog(1000*delay);
EnableWatchdog(1000*5);
ReinvokeISP();
};

View File

@ -126,7 +126,7 @@ bool lcdGetPixel(char x, char y){
return byte & (1 << y_off);
}
void lcdDisplay(uint32_t shift) {
void lcdDisplay(void) {
char byte;
select();
@ -137,9 +137,9 @@ void lcdDisplay(uint32_t shift) {
for(page=0; page<RESY_B;page++) {
for(i=0; i<RESX; i++) {
if (lcd_layout & LCD_MIRRORX)
byte=lcdBuffer[page*RESX+RESX-1-((i+shift)%RESX)];
byte=lcdBuffer[page*RESX+RESX-1-(i)];
else
byte=lcdBuffer[page*RESX+((i+shift)%RESX)];
byte=lcdBuffer[page*RESX+(i)];
if (lcd_layout & LCD_INVERTED)
byte=~byte;

View File

@ -22,7 +22,7 @@ extern uint8_t lcdBuffer[RESX*RESY_B];
void lcdInit(void);
void lcdFill(char f);
void lcdDisplay(uint32_t shift);
void lcdDisplay(void);
void lcdInvert(void);
void lcdToggleFlag(int flag);
void lcdSetPixel(char x, char y, bool f);

View File

@ -41,7 +41,7 @@ void lcdClear(){
};
void lcdRefresh(){
lcdDisplay(0);
lcdDisplay();
};
void lcdMoveCrsr(signed int dx,signed int dy){

View File

@ -52,7 +52,7 @@ void ram(void) {
draw_enemy();
draw_shot();
draw_status();
lcdDisplay(0);
lcdDisplay();
delayms(10);
}
return;

View File

@ -26,7 +26,7 @@ int main(void) {
lcdInit(); // display
lcdFill(0);
lcdDisplay(0);
lcdDisplay();
wrapper(); // see module/ subdirectory
}