diff options
| author | Joel Challis <git@zvecr.com> | 2020-01-13 01:30:56 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-13 01:30:56 +0000 |
| commit | b89e35bdd33b3953711de8b0be64c76b64e9701b (patch) | |
| tree | a597dafbaf6dfe50f94a70eade9954d78b84acd6 /quantum/backlight/backlight.c | |
| parent | 2ce3025be2fd28c7ea3f2fd33c7aba7277ff668b (diff) | |
| download | qmk_firmware-b89e35bdd33b3953711de8b0be64c76b64e9701b.tar.gz qmk_firmware-b89e35bdd33b3953711de8b0be64c76b64e9701b.zip | |
Relocate common backlight functionally (#7273)
Diffstat (limited to 'quantum/backlight/backlight.c')
| -rw-r--r-- | quantum/backlight/backlight.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c index 708022f68..e57b31d10 100644 --- a/quantum/backlight/backlight.c +++ b/quantum/backlight/backlight.c | |||
| @@ -21,6 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | 21 | ||
| 22 | backlight_config_t backlight_config; | 22 | backlight_config_t backlight_config; |
| 23 | 23 | ||
| 24 | // TODO: migrate to backlight_config_t | ||
| 25 | static uint8_t breathing_period = BREATHING_PERIOD; | ||
| 26 | |||
| 24 | /** \brief Backlight initialization | 27 | /** \brief Backlight initialization |
| 25 | * | 28 | * |
| 26 | * FIXME: needs doc | 29 | * FIXME: needs doc |
| @@ -191,3 +194,21 @@ void backlight_disable_breathing(void) { | |||
| 191 | */ | 194 | */ |
| 192 | bool is_backlight_breathing(void) { return backlight_config.breathing; } | 195 | bool is_backlight_breathing(void) { return backlight_config.breathing; } |
| 193 | #endif | 196 | #endif |
| 197 | |||
| 198 | // following are marked as weak purely for backwards compatibility | ||
| 199 | __attribute__((weak)) void breathing_period_set(uint8_t value) { breathing_period = value ? value : 1; } | ||
| 200 | |||
| 201 | __attribute__((weak)) uint8_t get_breathing_period(void) { return breathing_period; } | ||
| 202 | |||
| 203 | __attribute__((weak)) void breathing_period_default(void) { breathing_period_set(BREATHING_PERIOD); } | ||
| 204 | |||
| 205 | __attribute__((weak)) void breathing_period_inc(void) { breathing_period_set(breathing_period + 1); } | ||
| 206 | |||
| 207 | __attribute__((weak)) void breathing_period_dec(void) { breathing_period_set(breathing_period - 1); } | ||
| 208 | |||
| 209 | // defaults for backlight api | ||
| 210 | __attribute__((weak)) void backlight_init_ports(void) {} | ||
| 211 | |||
| 212 | __attribute__((weak)) void backlight_set(uint8_t level) {} | ||
| 213 | |||
| 214 | __attribute__((weak)) void backlight_task(void) {} | ||
