Add no scroll option for terminal

This commit is contained in:
Gordon Williams 2024-12-14 16:03:13 +00:00
parent e3f61b0e6e
commit b1c2dc4b3c
2 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,7 @@ This is a partial list of definitions that can be added in a `BOARD.py` file's `
* `ESPR_GRAPHICS_SELF_INIT` - Should the Graphics library instantiate itself with its own `g` instance?
* `ESPR_LCD_MANUAL_BACKLIGHT` - STM32/FSMC: Don't turn the backlight on and leave code to do this manually
* `ESPR_DISABLE_KICKWATCHDOG_PIN=BTN1_PININDEX` - If this pin is 1, skip kickWatchdog calls (which would eventually force a reboot if WDT enabled)
* `ESPR_TERMNINAL_NO_SCROLL` - disable scrolling in the onscreen terminal (once we get to the end, we just clear the screen and start at the top)
There are some specifically that are useful for cutting a few bytes out of the build:

View File

@ -105,7 +105,12 @@ void terminalScroll() {
#else
gfx.data.bgColor = 0;
#endif
#ifdef ESPR_TERMNINAL_NO_SCROLL
terminalY = 0;
graphicsClear(&gfx);
#else
graphicsScroll(&gfx, 0, -TERMINAL_CHAR_H); // always fill background in black
#endif
gfx.data.bgColor = cb;
terminalSetGFX(&gfx); // save
// if we're not in an IRQ, flip this now
@ -205,7 +210,11 @@ void terminalSendChar(char chn) {
void jswrap_terminal_init() {
terminalControlCharsReset();
terminalX = 0;
#ifdef ESPR_TERMNINAL_NO_SCROLL
terminalY = 0;
#else
terminalY = (unsigned char)(TERMINAL_HEIGHT-1);
#endif
}
/*JSON{