Mercurial > public > hwos_code
comparison src/adc_lightsensor.asm @ 357:36bd27f42362
BUGFIX: Auto-Brightness clipped to lowest settings in bright sunlight on some devices
| author | heinrichsweikamp |
|---|---|
| date | Sun, 02 Aug 2015 16:52:31 +0200 |
| parents | 043890f06bce |
| children | 4389fe9673b2 |
comparison
equal
deleted
inserted
replaced
| 356:fcf3ae0fee6a | 357:36bd27f42362 |
|---|---|
| 289 | 289 |
| 290 movlw .254 | 290 movlw .254 |
| 291 movwf ambient_light+0 ; avoid ADC clipping | 291 movwf ambient_light+0 ; avoid ADC clipping |
| 292 | 292 |
| 293 get_ambient_level2: | 293 get_ambient_level2: |
| 294 movlw .10 | 294 ; movlw .10 |
| 295 subwf ambient_light+0,F ; Subtract 10 (ADC Offset) | 295 ; subwf ambient_light+0,F ; Subtract 10 (ADC Offset) |
| 296 btfsc STATUS,N | 296 ; btfsc STATUS,N |
| 297 movwf ambient_light+0 ; avoid clipping | 297 ; movwf ambient_light+0 ; avoid clipping |
| 298 | 298 |
| 299 banksel isr_backup ; Back to Bank0 ISR data | 299 banksel isr_backup ; Back to Bank0 ISR data |
| 300 movff opt_brightness,isr1_temp | 300 movff opt_brightness,isr1_temp |
| 301 | 301 |
| 302 btfsc RCSTA1,7 ; UART module on? | 302 btfsc RCSTA1,7 ; UART module on? |
