Small front-end improvements + made screen clearing apply cursor color to cleared area

This commit is contained in:
2017-01-29 20:08:58 +01:00
parent 03179a0ff0
commit 0acf0bdd72
11 changed files with 46 additions and 87 deletions
+7 -18
View File
@@ -75,25 +75,18 @@ static volatile int notifyLock = 0;
if (notifyLock == 0) screen_notifyChange(); \
} while(0)
/**
* Reset a cell
*/
static inline void
cell_init(Cell *cell)
{
cell->c = ' ';
cell->fg = SCREEN_DEF_FG;
cell->bg = SCREEN_DEF_BG;
}
/**
* Clear range, inclusive
*/
static inline void
clear_range(unsigned int from, unsigned int to)
{
Color fg = cursor.inverse ? cursor.bg : cursor.fg;
Color bg = cursor.inverse ? cursor.fg : cursor.bg;
for (unsigned int i = from; i <= to; i++) {
cell_init(&screen[i]);
screen[i].c = ' ';
screen[i].fg = fg;
screen[i].bg = bg;
}
}
@@ -122,11 +115,7 @@ void ICACHE_FLASH_ATTR
screen_init(void)
{
NOTIFY_LOCK();
for (unsigned int i = 0; i < MAX_SCREEN_SIZE; i++) {
cell_init(&screen[i]);
}
cursor_reset();
screen_reset();
NOTIFY_DONE();
}
@@ -137,8 +126,8 @@ void ICACHE_FLASH_ATTR
screen_reset(void)
{
NOTIFY_LOCK();
screen_clear(CLEAR_ALL);
cursor_reset();
screen_clear(CLEAR_ALL);
NOTIFY_DONE();
}
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef USER_MAIN_H_H
#define USER_MAIN_H_H
#define FIRMWARE_VERSION "0.4"
#define FIRMWARE_VERSION "0.5"
#define TERMINAL_GITHUB_REPO "https://github.com/MightyPork/esp-vt100-firmware"
#endif //USER_MAIN_H_H