feat: update

This commit is contained in:
but0n 2016-12-21 23:41:38 +08:00
parent f9c4eafacd
commit 5e07e04549
3 changed files with 11 additions and 13 deletions

View File

@ -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|

View File

@ -17,8 +17,9 @@ unsigned char cli_cache[CACHE_HEIGHT][CACHE_WIDTH] = {};
void cli_fresh() {
for(unsigned char x = 0; x < CACHE_WIDTH; x++) {
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];
}
}

View File

@ -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);
}
}