File tree Expand file tree Collapse file tree 6 files changed +70
-36
lines changed Expand file tree Collapse file tree 6 files changed +70
-36
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ static rt_err_t alarm_set(struct rt_alarm *alarm)
52
52
struct rt_rtc_wkalarm wkalarm ;
53
53
rt_err_t ret ;
54
54
55
+ #ifdef RT_USING_SOFT_RTC
56
+ device = rt_device_find ("sw_rtc" );
57
+ #else
55
58
device = rt_device_find ("rtc" );
59
+ #endif
56
60
57
61
if (device == RT_NULL )
58
62
{
Original file line number Diff line number Diff line change @@ -226,8 +226,8 @@ static int rt_soft_rtc_init(void)
226
226
{
227
227
return 0 ;
228
228
}
229
- /* make sure only one 'rtc ' device */
230
- RT_ASSERT (!rt_device_find ("rtc " ));
229
+ /* make sure only one 'sw_rtc ' device */
230
+ RT_ASSERT (!rt_device_find ("sw_rtc " ));
231
231
232
232
#ifdef RT_USING_ALARM
233
233
rt_timer_init (& alarm_time ,
@@ -258,7 +258,9 @@ static int rt_soft_rtc_init(void)
258
258
/* no private */
259
259
soft_rtc_dev .user_data = RT_NULL ;
260
260
261
- rt_device_register (& soft_rtc_dev , "rtc" , RT_DEVICE_FLAG_RDWR );
261
+ rt_device_register (& soft_rtc_dev , "sw_rtc" , RT_DEVICE_FLAG_RDWR );
262
+
263
+ source_device = & soft_rtc_dev ;
262
264
263
265
init_ok = RT_TRUE ;
264
266
@@ -317,7 +319,7 @@ static void cmd_rtc_sync(int argc, char **argv)
317
319
rt_kprintf ("local time: %.*s" , 25 , ctime (& now ));
318
320
rt_kprintf ("timestamps: %ld\n" , (long )tv .tv_sec );
319
321
}
320
- MSH_CMD_EXPORT_ALIAS (cmd_rtc_sync , rtc_sync , Update time by real rtc );
322
+ MSH_CMD_EXPORT_ALIAS (cmd_rtc_sync , rtc_sync , Update time by soft rtc );
321
323
#endif
322
324
323
325
#endif /* RT_USING_SYSTEM_WORKQUEUE */
Original file line number Diff line number Diff line change 12
12
@ (c) Texas Instruments 2009 - 2013 , All rights reserved.
13
13
@
14
14
15
- //#include <rtconfig.h>
16
-
17
15
. equ Mode_USR , 0x10
18
16
. equ Mode_FIQ , 0x11
19
17
. equ Mode_IRQ , 0x12
@@ -47,7 +45,7 @@ stack_top:
47
45
.text
48
46
.arm
49
47
50
- .globl _c_int00
48
+ .globl entry
51
49
52
50
.globl _reset
53
51
_reset:
@@ -122,7 +120,7 @@ next2:
122
120
next3:
123
121
bl next4
124
122
next4:
125
- ldr lr , =_c_int00
123
+ ldr lr , =entry
126
124
bx lr
127
125
128
126
.globl data_init
@@ -479,26 +477,38 @@ turnon_VFP:
479
477
str lr , [ r0 , # 14 * 4 ] @/ * Save calling PC * /
480
478
.endm
481
479
482
- .globl vector_svc
483
- vector_svc:
484
- push_svc_reg
485
- bl rt_hw_trap_svc
486
- b .
487
-
488
- .globl vector_pabort
489
- vector_pabort:
490
- push_svc_reg
491
- bl rt_hw_trap_pabt
492
- b .
493
-
494
- .globl vector_dabort
495
- vector_dabort:
496
- push_svc_reg
497
- bl rt_hw_trap_dabt
498
- b .
499
-
500
- .globl vector_resv
501
- vector_resv:
502
- push_svc_reg
503
- bl rt_hw_trap_resv
504
- b .
480
+ .globl SWI_Handler
481
+ SWI_Handler:
482
+ push_svc_reg
483
+ bl rt_hw_trap_swi
484
+ b .
485
+
486
+ .globl Undefined_Handler
487
+ Undefined_Handler:
488
+ push_svc_reg
489
+ bl rt_hw_trap_undef
490
+ b .
491
+
492
+ .globl SVC_Handler
493
+ SVC_Handler:
494
+ push_svc_reg
495
+ b rt_hw_trap_svc
496
+ b .
497
+
498
+ .globl Prefetch_Handler
499
+ Prefetch_Handler:
500
+ push_svc_reg
501
+ b rt_hw_trap_pabt
502
+ b .
503
+
504
+ .globl Abort_Handler
505
+ Abort_Handler:
506
+ push_svc_reg
507
+ b rt_hw_trap_dabt
508
+ b .
509
+
510
+ .globl Reserved_Handler
511
+ Reserved_Handler:
512
+ push_svc_reg
513
+ b rt_hw_trap_resv
514
+ b .
Original file line number Diff line number Diff line change @@ -31,11 +31,13 @@ ABT_Stack_Size EQU 0x00000000
31
31
FIQ_Stack_Size EQU 0x00001000
32
32
IRQ_Stack_Size EQU 0x00001000
33
33
34
- IMPORT _c_int00
34
+ IMPORT entry
35
35
IMPORT rt_hw_trap_svc
36
36
IMPORT rt_hw_trap_pabt
37
37
IMPORT rt_hw_trap_dabt
38
38
IMPORT rt_hw_trap_resv
39
+ IMPORT rt_hw_trap_swi
40
+ IMPORT rt_hw_trap_undef
39
41
IMPORT system_init
40
42
IMPORT __iar_program_start
41
43
@@ -308,6 +310,18 @@ turnon_VFP:
308
310
str lr , [ r0 , # 14 * 4 ] ;@/* Save calling PC */
309
311
endm
310
312
313
+ EXPORT SWI_Handler
314
+ SWI_Handler:
315
+ push_svc_reg
316
+ bl rt_hw_trap_swi
317
+ b .
318
+
319
+ EXPORT Undefined_Handler
320
+ Undefined_Handler:
321
+ push_svc_reg
322
+ bl rt_hw_trap_undef
323
+ b .
324
+
311
325
EXPORT SVC_Handler
312
326
SVC_Handler:
313
327
push_svc_reg
Original file line number Diff line number Diff line change 19
19
@ import reference for interrupt routines
20
20
21
21
.globl Reset_Handler
22
- .globl turnon_VFP
22
+ .globl Undefined_Handler
23
+ .globl SWI_Handler
23
24
.globl SVC_Handler
24
25
.globl Prefetch_Handler
25
26
.globl Abort_Handler
28
29
.globl FIQ_Handler
29
30
30
31
31
- .globl system_vectors
32
- system_vectors :
32
+ .globl system_vector
33
+ system_vector :
33
34
b Reset_Handler
34
- b turnon_VFP
35
+ b Undefined_Handler
36
+ b SWI_Handler
35
37
b SVC_Handler
36
38
b Prefetch_Handler
37
39
b Abort_Handler
Original file line number Diff line number Diff line change 20
20
21
21
IMPORT Reset_Handler
22
22
IMPORT Undefined_Handler
23
+ IMPORT SWI_Handler
23
24
IMPORT SVC_Handler
24
25
IMPORT Prefetch_Handler
25
26
IMPORT Abort_Handler
35
36
system_vectors:
36
37
b Reset_Handler
37
38
b Undefined_Handler
39
+ b SWI_Handler
38
40
b SVC_Handler
39
41
b Prefetch_Handler
40
42
b Abort_Handler
You can’t perform that action at this time.
0 commit comments