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
|
.thumb
.globl rwble_reset
.thumb_func
rwble_reset:
push {r3, r4, r5, lr}
bl portDISABLE_FIQ
add r5, r0, #0
bl portDISABLE_IRQ
movs r2, #128 // 0x80
add r4, r0, #0
ldr r3, BLE_BASETIMECNT_ADDR
lsl r2, r2, #24
str r2, [r3, #0]
2:
ldr r2, [r3, #0]
cmp r2, #0
blt 2b
ldr r2, BLE_FINETIMECNT_ADDR
ldr r3, BLE_BASETIMECNT_ADDR
ldr r3, [r3, #0]
ldr r0, [r2, #0]
add r0, r0, r3
ldr r3, BLE_BDADDRL_ADDR
ldr r3, [r3, #0]
add r0, r0, r3
bl srand
bl lld_core_reset
movs r0, #1
bl lld_init
movs r0, #1
bl lld_adv_test_init
bl llc_reset
movs r0, #1
bl llm_init
bl em_buf_init
cmp r5, #0
bne 0f
bl portENABLE_FIQ
0:
cmp r4, #0
bne 1f
bl portENABLE_IRQ
1:
pop {r3, r4, r5, pc}
.balign 4
BLE_BASETIMECNT_ADDR:
.word 0x0081001c // BLE_BASETIMECNT_ADDR
BLE_FINETIMECNT_ADDR:
.word 0x00810020 // BLE_FINETIMECNT_ADDR
BLE_BDADDRL_ADDR:
.word 0x00810024 // BLE_BDADDRL_ADDR
|