aboutsummaryrefslogtreecommitdiff
path: root/src/tty.c
diff options
context:
space:
mode:
authorThomas Albers Raviola <thomas@thomaslabs.org>2024-12-03 21:46:19 +0100
committerThomas Albers Raviola <thomas@thomaslabs.org>2024-12-03 21:46:19 +0100
commit08b7ee440269c881546421da6efe1b6ae122b566 (patch)
treed3140184165f36acf49116e3a7886c15e5895e27 /src/tty.c
parentd46862a5bd2319c595b11427f781201ca063d194 (diff)
Change pixel format
Diffstat (limited to 'src/tty.c')
-rw-r--r--src/tty.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tty.c b/src/tty.c
index f9413b4..c630e23 100644
--- a/src/tty.c
+++ b/src/tty.c
@@ -23,11 +23,12 @@ extern const uint8_t font[97][8];
static uint8_t cursor = 0;
static uint8_t timer = 0;
+u8 blink = 0;
void
blink_cursor(void) __critical __interrupt(3)
{
- if (++timer >= 75) {
+ if (++timer >= 75 && blink) {
uint8_t i;
tft_set_area(8 * col, 8 * row, 8, 8);
@@ -131,10 +132,18 @@ addch(char c)
return;
}
- tft_set_area(8 * col, 8 * row, 8, 8);
+ DI;
+ u8 tmp = blink;
+ blink = 0;
+ EI;
+ tft_set_area(8 * col, 8 * row, 8, 8);
draw(c);
+ DI;
+ blink = tmp;
+ EI;
+
buf[(head + row) % TTY_HEIGHT][col] = c;
advance();
}