diff --git a/libs/include/cli.h b/libs/include/cli.h index 1cadb0e..8fcb9be 100644 --- a/libs/include/cli.h +++ b/libs/include/cli.h @@ -5,10 +5,12 @@ #define BLOCK_WIDTH 2 #define BLOCK_HEIGHT 8 -#define WIDTH 40 -#define HEIGHT 40 -#define CACHE_WIDTH WIDTH/BLOCK_WIDTH -#define CACHE_HEIGHT HEIGHT/BLOCK_HEIGHT +#define WIDTH 200 +#define HEIGHT 160 +#define GET_WIDTH(x) (x)/BLOCK_WIDTH +#define GET_HEIGHT(x) (x)/BLOCK_HEIGHT +#define CACHE_WIDTH GET_WIDTH(WIDTH) +#define CACHE_HEIGHT GET_HEIGHT(HEIGHT) // --- // |0 3| diff --git a/libs/source/cli.c b/libs/source/cli.c index 1207aae..f3162e7 100644 --- a/libs/source/cli.c +++ b/libs/source/cli.c @@ -17,8 +17,9 @@ unsigned char cli_cache[CACHE_HEIGHT][CACHE_WIDTH] = {}; void cli_fresh() { - for(unsigned char x = 0; x < CACHE_WIDTH; x++) { - for(unsigned char y = 0; y < CACHE_HEIGHT; y++) { + UART_CLEAR(); + for(unsigned char y = 0; y < CACHE_HEIGHT; y++) { + for(unsigned char x = 0; x < CACHE_WIDTH; x++) { cli_drawBlock(&cli_cache[y][x]); } UART_CR(); @@ -37,8 +38,6 @@ void cli_drawSpot(unsigned char x, unsigned char y) { unsigned char x_offset = x % BLOCK_WIDTH; unsigned char y_offset = y % BLOCK_HEIGHT; // Get position of block - x /= BLOCK_WIDTH; - y /= BLOCK_HEIGHT; - cli_cache[y][x] |= cli_bitmap[y_offset][x_offset]; + cli_cache[GET_HEIGHT(y)][GET_WIDTH(x)] |= cli_bitmap[y_offset][x_offset]; } } diff --git a/src/main.c b/src/main.c index 7d4db1a..1af9d8b 100644 --- a/src/main.c +++ b/src/main.c @@ -185,11 +185,8 @@ void uart_debugPID() { void drawille_task() { while(1) { - UART_CLEAR(); - for(unsigned char x = 0; x< WIDTH; x++) { - cli_drawSpot(x,x); - } cli_fresh(); + vTaskDelay(1000); } }