feat: Update

This commit is contained in:
but0n 2016-12-21 09:37:21 +08:00
parent a1dd58e3a6
commit f9c4eafacd
3 changed files with 11 additions and 9 deletions

View File

@ -5,8 +5,10 @@
#define BLOCK_WIDTH 2 #define BLOCK_WIDTH 2
#define BLOCK_HEIGHT 8 #define BLOCK_HEIGHT 8
#define WIDTH 80/BLOCK_WIDTH #define WIDTH 40
#define HEIGHT 80/BLOCK_HEIGHT #define HEIGHT 40
#define CACHE_WIDTH WIDTH/BLOCK_WIDTH
#define CACHE_HEIGHT HEIGHT/BLOCK_HEIGHT
// --- // ---
// |0 3| // |0 3|

View File

@ -6,19 +6,19 @@
// 0x2800 - braille unicode offset // 0x2800 - braille unicode offset
// 0010 1000 : 0000 0000 // 0010 1000 : 0000 0000
const char cli_bitmap[4][2] = { const char cli_bitmap[BLOCK_HEIGHT][BLOCK_WIDTH] = {
{0x01, 0x08}, {0x01, 0x08},
{0x02, 0x10}, {0x02, 0x10},
{0x04, 0x20}, {0x04, 0x20},
{0x40, 0x80} {0x40, 0x80}
}; };
unsigned char cli_cache[HEIGHT][WIDTH] = {}; unsigned char cli_cache[CACHE_HEIGHT][CACHE_WIDTH] = {};
void cli_fresh() { void cli_fresh() {
for(unsigned char x = 0; x < WIDTH; x++) { for(unsigned char x = 0; x < CACHE_WIDTH; x++) {
for(unsigned char y = 0; y < HEIGHT; y++) { for(unsigned char y = 0; y < CACHE_HEIGHT; y++) {
cli_drawBlock(&cli_cache[y][x]); cli_drawBlock(&cli_cache[y][x]);
} }
UART_CR(); UART_CR();

View File

@ -186,9 +186,9 @@ void uart_debugPID() {
void drawille_task() { void drawille_task() {
while(1) { while(1) {
UART_CLEAR(); UART_CLEAR();
cli_drawSpot(0,0); for(unsigned char x = 0; x< WIDTH; x++) {
cli_drawSpot(0,1); cli_drawSpot(x,x);
cli_drawSpot(0,2); }
cli_fresh(); cli_fresh();
} }
} }