Mercurial > public > hwos_code
comparison 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 |
comparison
equal
deleted
inserted
replaced
415:fd3865a82519 | 416:4389fe9673b2 |
---|---|
436 bcf adc_running ; =1: The ADC is in use | 436 bcf adc_running ; =1: The ADC is in use |
437 return | 437 return |
438 | 438 |
439 global piezo_config ; Sets up piezo sensitivity of heinrichs weikamp Piezo buttons (~30ms) | 439 global piezo_config ; Sets up piezo sensitivity of heinrichs weikamp Piezo buttons (~30ms) |
440 piezo_config: ; Settings between 20 and 200 | 440 piezo_config: ; Settings between 20 and 200 |
441 clrf TMR5H | |
442 clrf TMR5L ; ~2sec | |
443 bcf PIR5,TMR5IF ; Clear flag | |
444 bcf switch_right | |
445 bcf switch_left | |
446 piezo_config0: | |
447 btfsc switch_right | |
448 bra piezo_config | |
449 btfsc switch_left | |
450 bra piezo_config ; Restart on button press | |
451 | |
452 btfss PIR5,TMR5IF | |
453 bra piezo_config0 ; Wait loop | |
454 | |
441 movff opt_cR_button_right,WREG; right button | 455 movff opt_cR_button_right,WREG; right button |
442 btfsc flip_screen ; 180° rotation ? | 456 btfsc flip_screen ; 180° rotation ? |
443 movff opt_cR_button_left,WREG ; Yes, left button | 457 movff opt_cR_button_left,WREG ; Yes, left button |
444 rcall piezo_config_tx | 458 rcall piezo_config_tx |
445 | 459 |