bugfix u8log, issue #606
This commit is contained in:
parent
9fd8936111
commit
2328618ddb
|
@ -86,6 +86,8 @@ static void u8log_scroll_up(u8log_t *u8log)
|
|||
|
||||
if ( u8log->is_redraw_line_for_each_char )
|
||||
u8log->is_redraw_all = 1;
|
||||
else
|
||||
u8log->is_redraw_all_required_for_next_nl = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -93,6 +95,7 @@ static void u8log_scroll_up(u8log_t *u8log)
|
|||
*/
|
||||
static void u8log_cursor_on_screen(u8log_t *u8log)
|
||||
{
|
||||
//printf("u8log_cursor_on_screen, cursor_y=%d\n", u8log->cursor_y);
|
||||
if ( u8log->cursor_x >= u8log->width )
|
||||
{
|
||||
u8log->cursor_x = 0;
|
||||
|
@ -139,6 +142,9 @@ void u8log_write_char(u8log_t *u8log, uint8_t c)
|
|||
case '\n': // 10
|
||||
u8log->is_redraw_line = 1;
|
||||
u8log->redraw_line = u8log->cursor_y;
|
||||
if ( u8log->is_redraw_all_required_for_next_nl )
|
||||
u8log->is_redraw_all = 1;
|
||||
u8log->is_redraw_all_required_for_next_nl = 0;
|
||||
u8log->cursor_y++;
|
||||
u8log->cursor_x = 0;
|
||||
break;
|
||||
|
|
|
@ -397,6 +397,7 @@ struct u8log_struct
|
|||
uint8_t redraw_line; /* redraw specific line if is_redraw_line is not 0 */
|
||||
uint8_t is_redraw_line;
|
||||
uint8_t is_redraw_all;
|
||||
uint8_t is_redraw_all_required_for_next_nl; /* in nl mode, redraw all instead of current line */
|
||||
};
|
||||
typedef struct u8log_struct u8log_t;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ int main(void)
|
|||
|
||||
u8log_Init(&u8log, U8LOG_WIDTH, U8LOG_HEIGHT, u8log_buf);
|
||||
u8log_SetCallback(&u8log, u8log_u8x8_cb, &u8x8);
|
||||
u8log_SetRedrawMode(&u8log, /* is_redraw_line_for_each_char = */ 1);
|
||||
//u8log_SetRedrawMode(&u8log, /* is_redraw_line_for_each_char = */ 0);
|
||||
//u8log_SetRedrawMode(&u8log, /* is_redraw_line_for_each_char = */ 1);
|
||||
u8log_SetRedrawMode(&u8log, /* is_redraw_line_for_each_char = */ 0);
|
||||
|
||||
t = clock()+CLOCKS_PER_SEC/10;
|
||||
for(;;)
|
||||
|
|
Loading…
Reference in New Issue