Skip to content

Commit

Permalink
Add no scroll option for terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed Dec 14, 2024
1 parent e3f61b0 commit b1c2dc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README_BuildProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions libs/graphics/jswrap_terminal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit b1c2dc4

Please sign in to comment.