mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
ctk-curses: style fixes
This commit is contained in:
parent
8daf2b6659
commit
a03334a59d
@ -101,6 +101,7 @@ console_init(void)
|
||||
mmask_t oldmask;
|
||||
#endif
|
||||
static unsigned char done;
|
||||
int bg, fg;
|
||||
|
||||
if(done) {
|
||||
return;
|
||||
@ -129,14 +130,12 @@ console_init(void)
|
||||
|
||||
screensize(&width, &height);
|
||||
|
||||
/* curses color handling is weird... */
|
||||
{
|
||||
int bg, fg;
|
||||
|
||||
for(fg = 0; fg < 8; fg++)
|
||||
for(bg = 0; bg < 8; bg++)
|
||||
/* we must declare all possible color pairs */
|
||||
for(fg = 0; fg < 8; fg++) {
|
||||
for(bg = 0; bg < 8; bg++) {
|
||||
init_pair(MKPAIR(bg, fg), fg, bg);
|
||||
}
|
||||
}
|
||||
|
||||
/* set window title */
|
||||
putp("\033]0;Contiki\a");
|
||||
@ -195,8 +194,9 @@ setcolor(void)
|
||||
bg = (color & 0xF0) >> 4;
|
||||
|
||||
attrs = COLOR_PAIR(MKPAIR(bg, fg));
|
||||
if(reversed)
|
||||
if(reversed) {
|
||||
attrs |= WA_REVERSE;
|
||||
}
|
||||
attrset(attrs);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
@ -443,9 +443,10 @@ console_read(void)
|
||||
int k;
|
||||
|
||||
k = getch();
|
||||
if(k != ERR)
|
||||
if(k != ERR) {
|
||||
console_readkey(k);
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
char
|
||||
ctk_arch_getkey(void)
|
||||
|
Loading…
Reference in New Issue
Block a user