Fix PFW-1357 (#35)

lcd_encoder_diff would be set to 0 if lcd_update_enable(true)
is called outside ReportErrorHookMonitor
This would put enc_dif out of sync with lcd_encoder_diff and could cause false rotation triggering
This commit is contained in:
Guðni Már Gilbert 2022-06-26 14:11:02 +00:00 committed by D.R.racer
parent d7d6885765
commit 4dd689ba9a
1 changed files with 8 additions and 1 deletions

View File

@ -100,7 +100,14 @@ extern void ReportErrorHookSensorLineRender()
static uint8_t ReportErrorHookMonitor(uint8_t ei) {
uint8_t ret = 0;
bool two_choices = false;
static int8_t enc_dif = 0;
static int8_t enc_dif = lcd_encoder_diff;
if (lcd_encoder_diff == 0)
{
// lcd_update_enable(true) was called outside ReportErrorHookMonitor
// It will set lcd_encoder_diff to 0, sync enc_dif
enc_dif = 0;
}
// Read and determine what operations should be shown on the menu
const uint8_t button_operation = PrusaErrorButtons(ei);