haptic: improve what happens if solenoid is enabled without erasing eeprom
authorPurdea Andrei <andrei@purdea.ro>
Sat, 11 Jul 2020 03:04:43 +0000 (06:04 +0300)
committerPurdea Andrei <andrei@purdea.ro>
Sat, 11 Jul 2020 03:06:22 +0000 (06:06 +0300)
drivers/haptic/haptic.c

index 6a09c4f..6cd699b 100644 (file)
@@ -167,6 +167,10 @@ void haptic_reset(void) {
     haptic_config.dwell = dwell;
     haptic_config.buzz  = SOLENOID_DEFAULT_BUZZ;
     solenoid_set_dwell(dwell);
+#else
+    // This is to trigger haptic_reset again, if solenoid is enabled in the future.
+    haptic_config.dwell = 0;
+    haptic_config.buzz  = 0;
 #endif
     eeconfig_update_haptic(haptic_config.raw);
     xprintf("haptic_config.feedback = %u\n", haptic_config.feedback);