-
Notifications
You must be signed in to change notification settings - Fork 1
/
Backlight_Lightup_Increase_in_Notifications_210_v1.pbp
79 lines (68 loc) · 1.96 KB
/
Backlight_Lightup_Increase_in_Notifications_210_v1.pbp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
; This patch increases backlight light-up time
; from 3 to 6 seconds (by default),
; but only for incoming notifications.
; Backlight time for other events (button press, shake...)
; will remain 3 seconds.
;
; PLEASE NOTE that backlight is very battery-hungry!
; So this patch might noticeable decrease battery uptime.
;
; Thanks to Suzanne Schiller for the idea.
#ver 210 219
;@notification_backlight_timeout_ms val
; This option controls backlight timeout for notifications.
; Value is in milliseconds, i.e. 6000 ms = 6 seconds.
; Stock default value is 3 seconds.
; Maximum possible is 65535 ms (65 seconds)
#default notification_backlight_timeout_ms 6000
; in the end of notifications_handle_new_notification:
04 f1 50 00 a9 68 ?4 ?4 08 b1 ?4
@ ?4 bd e8 38 40 ?4 38 bd {
; was: BL light_enable_with_timeout
BL my_light_enable_with_bigger_timeout
}
3e 4b f7 b5 1e 68 3e 4b {
proc light_timer_cb
}
2d e9 f8 4f 0a 9f 83 46 {
proc new_timer_start
}
38 b5 ?4 04 46 00 bb {
proc is_backlight_enabled
}
; for light_timer_id: in data block of light_do_action proc
; it is a memory cell storing address of timer id
38 b9 06 48 ?4 03 b0 5d f8 04 eb ?4
03 b0 00 bd
@ ?4 ?4 ?4 ; data block: our val, ptr to light_timer_cb and log msg code
10 b5 ; and next proc for disambiguation
{
; remember 4-bytes value
val light_timer_id_val
}
; instead of cmdNowPlaying
30 b5 bb b0 0a ad 12 ac 02 a8 29 46 22 46 ?2
?2 00 95 01 94 1a a8 80 21 03 4a 02 ab ?2
?2 3b b0 30 bd 00 bf ?4
{
proc my_light_enable_with_bigger_timeout
db 00 B5 ; PUSH LR
BL is_backlight_enabled
CBZ R0, ret
; enable backlight
MOV R0, 1 ; action: turn on
BL light_timer_cb
; and schedule backlight off in 6 seconds (or what user chose):
LDR R0, light_timer_id
LDR R0, [R0]
MOV.W R1, ${notification_backlight_timeout_ms} ; delay
LDR R2, light_timer_cb_addr
MOV R3, 3 ; action: fade out
BL new_timer_start
ret:
db 00 BD ; POP PC
light_timer_id:
DCD light_timer_id_val
light_timer_cb_addr:
DCD light_timer_cb+1
}