-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBacklight_Lightup_Increase_in_Notifications_260_v1.pbp
75 lines (64 loc) · 1.76 KB
/
Backlight_Lightup_Increase_in_Notifications_260_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
; 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 260
;@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:
95 f8 55 32 3b b1 0d 48 ?4
0d 48 d4 f8 01 10 ?4 ?4 18 b1 ?4 ?4
@ ?4 bd e8 70 40 04 48 ?4
{
; was: BL light_enable_with_timeout
BL my_light_enable_with_bigger_timeout
}
10 b5 06 4c e0 68 ?4 {
proc light_timer_cb
}
2d e9 f7 4f 83 46 0c 46 {
proc new_timer_start
}
10 b5 ?4 04 46 90 b9 {
proc is_backlight_enabled
}
; for light_timer_id: in data block of light_do_action proc
; it is a memory cell storing address of light state struct, timer id is it + 4
03 20 ?4 e0 68 bd e8 10 40 ?4 00 bf @ ?4
{
; remember 4-bytes value
val light_timer_state_val
}
; and append our code
{
proc my_light_enable_with_bigger_timeout
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:
POP {PC}
light_timer_id:
DCD light_timer_state_val+4
light_timer_cb_addr:
DCD light_timer_cb+1
}