LCD Timing changes

This commit is contained in:
Mario Hüttel 2020-06-14 01:04:21 +02:00
parent 7595e6ced8
commit 0fca4c6c20
2 changed files with 16 additions and 5 deletions

View File

@ -152,6 +152,7 @@ static void reflow_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_e
if (entry_type != MENU_ENTRY_CONTINUE) { if (entry_type != MENU_ENTRY_CONTINUE) {
menu_display_clear(menu); menu_display_clear(menu);
update_display_buffer(0, "Main Menu"); update_display_buffer(0, "Main Menu");
menu_ack_rotary_delta(menu);
if (entry_type == MENU_ENTRY_FIRST_ENTER) { if (entry_type == MENU_ENTRY_FIRST_ENTER) {
button_valid = false; button_valid = false;
list.entry_names = root_entry_names; list.entry_names = root_entry_names;
@ -194,7 +195,7 @@ int reflow_menu_handle()
menu_handle(reflow_menu_ptr, (int16_t)rot_delta, button); menu_handle(reflow_menu_ptr, (int16_t)rot_delta, button);
if (lcd_ret != LCD_FSM_WAIT_CALL || lcd_tick_ms >= 2) { if (lcd_ret != LCD_FSM_WAIT_CALL || lcd_tick_ms >= 1) {
lcd_ret = lcd_fsm_write_buffer(display_buffer); lcd_ret = lcd_fsm_write_buffer(display_buffer);
lcd_tick_ms = 0UL; lcd_tick_ms = 0UL;
} }

View File

@ -305,12 +305,22 @@ static void lcd_fsm_enable(bool en)
__ASM("nop"); __ASM("nop");
__ASM("nop"); __ASM("nop");
__ASM("nop"); __ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
if (en) if (en)
LCD_DPORT->ODR |= LCD_E_MASK; LCD_DPORT->ODR |= LCD_E_MASK;
else else
LCD_DPORT->ODR &= ~LCD_E_MASK; LCD_DPORT->ODR &= ~LCD_E_MASK;
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop");
__ASM("nop"); __ASM("nop");
__ASM("nop"); __ASM("nop");
__ASM("nop"); __ASM("nop");
@ -393,7 +403,7 @@ enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21])
state_cnt++; state_cnt++;
break; break;
case 4: case 4:
if (!systick_ticks_have_passed(timestamp, 4)) { if (!systick_ticks_have_passed(timestamp, 5)) {
ret = LCD_FSM_WAIT_CALL; ret = LCD_FSM_WAIT_CALL;
} else { } else {
ret = LCD_FSM_CALL_AGAIN; ret = LCD_FSM_CALL_AGAIN;
@ -408,7 +418,7 @@ enum lcd_fsm_ret lcd_fsm_write_buffer(const char (*display_buffer)[21])
break; break;
case 6: case 6:
lcd_fsm_enable(false); lcd_fsm_enable(false);
ret = LCD_FSM_CALL_AGAIN; ret = LCD_FSM_WAIT_CALL;
state_cnt++; state_cnt++;
break; break;
case 7: case 7: