]> www.fi.muni.cz Git - bike-lights.git/commitdiff
braking is handled behind the patterns inside pattern.c
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 20:35:37 +0000 (22:35 +0200)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 26 Jun 2013 20:36:59 +0000 (22:36 +0200)
See the comment above pwmled_update_mode():

This is tricky: we use a single pattern for all three pwmleds,
but on some occasions, we want to be able to modify only a single
pwmled status without affecting other outputs. For example, during
braking, we want to modify only the rear pwmled status. We don't
use a separate "braking" pattern for every other pattern used, but instead
we change the pwmled0 status regardless of the original value when
braking. The rule is the following:
- if during braking the pwmled2 (front) is at mode 2, we switch it to
    mode 3 (which has the same target current) to avoid flicker.
- if pwmled0 (rear) is off, we set it to mode 2
    (if it is with mode 1, we keep it at mode 1)
TODO: something similar should be done for the "entering the dark area"
    condition, where we want to switch pwmled2 (front) on, to mode 2.


No differences found