-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbacklight_control.c
59 lines (40 loc) · 1.12 KB
/
backlight_control.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/***
* HC-11 wireless modem emulator for the Flipper Zero
* Version: 1.1
*
* Display backlight control
***/
/*** Includes ***/
#include <notification/notification_messages.h>
#include "backlight_control.h"
/*** Routines ***/
/** Setup the backlight control **/
void set_backlight_control(BacklightControl *blc) {
/* Enable notifications */
blc->notifications = furi_record_open(RECORD_NOTIFICATION);
}
/** Release the backlight control **/
void release_backlight_control(void) {
/* Disable notifications */
furi_record_close(RECORD_NOTIFICATION);
}
/** Set the backlight on, off or automatic */
void set_backlight(BacklightControl *blc, uint8_t state) {
/* Set the backlight in the specified state */
switch(state) {
case BL_OFF:
notification_message(blc->notifications,
&sequence_display_backlight_off);
break;
case BL_ON:
notification_message(blc->notifications,
&sequence_display_backlight_enforce_on);
break;
case BL_AUTO:
notification_message(blc->notifications,
&sequence_display_backlight_enforce_auto);
break;
default:
return;
}
}