diff src/adc_lightsensor.asm @ 416:4389fe9673b2

NEW: Support for new logbook memory chip (minor hardware change) BUGFIX: Button sensitivity was not reset after update in some cases
author heinrichsweikamp
date Mon, 18 Apr 2016 14:34:57 +0200
parents 36bd27f42362
children aadfe9f2edaf
line wrap: on
line diff
--- a/src/adc_lightsensor.asm	Sun Apr 10 11:46:55 2016 +0200
+++ b/src/adc_lightsensor.asm	Mon Apr 18 14:34:57 2016 +0200
@@ -438,6 +438,20 @@
 
     global  piezo_config            ; Sets up piezo sensitivity of heinrichs weikamp Piezo buttons (~30ms)
 piezo_config:   ; Settings between 20 and 200
+        clrf	TMR5H
+	clrf	TMR5L	    ; ~2sec
+	bcf		PIR5,TMR5IF			; Clear flag
+	bcf	switch_right
+	bcf	switch_left
+piezo_config0:
+	btfsc	switch_right
+	bra	piezo_config
+	btfsc	switch_left
+	bra	piezo_config		; Restart on button press
+    
+	btfss	PIR5,TMR5IF
+	bra	piezo_config0			; Wait loop
+    
     movff   opt_cR_button_right,WREG; right button
     btfsc   flip_screen             ; 180° rotation ?
     movff   opt_cR_button_left,WREG ; Yes, left button