Browse Source

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
Guðni Már Gilbert 2 years ago
parent
commit
4dd689ba9a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Firmware/mmu2_reporting.cpp

+ 8 - 1
Firmware/mmu2_reporting.cpp

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