Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
红岛
rt-thread
提交
4acd8db6
R
rt-thread
项目概览
红岛
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4acd8db6
编写于
4月 10, 2019
作者:
xuzhuoyi96
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bsp][tms320f28379d] Add finsh init in rt_init_thread
上级
4518a896
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
56 addition
and
12 deletion
+56
-12
bsp/tms320f28379d/applications/application.c
bsp/tms320f28379d/applications/application.c
+6
-3
bsp/tms320f28379d/drivers/board.c
bsp/tms320f28379d/drivers/board.c
+10
-1
bsp/tms320f28379d/drivers/drv_sci.c
bsp/tms320f28379d/drivers/drv_sci.c
+1
-3
libcpu/ti-dsp/c28x/context.s
libcpu/ti-dsp/c28x/context.s
+35
-5
libcpu/ti-dsp/c28x/cpuport.c
libcpu/ti-dsp/c28x/cpuport.c
+4
-0
未找到文件。
bsp/tms320f28379d/applications/application.c
浏览文件 @
4acd8db6
...
@@ -12,12 +12,15 @@
...
@@ -12,12 +12,15 @@
#include <board.h>
#include <board.h>
#include <rtthread.h>
#include <rtthread.h>
#ifdef RT_USING_FINSH
#include "shell.h"
#endif
void
rt_init_thread_entry
(
void
*
parameter
)
void
rt_init_thread_entry
(
void
*
parameter
)
{
{
/* initialization RT-Thread Components */
#ifdef RT_USING_FINSH
rt_components_init
();
finsh_system_init
();
finsh_system_init
();
#endif
}
}
int
rt_application_init
()
int
rt_application_init
()
...
...
bsp/tms320f28379d/drivers/board.c
浏览文件 @
4acd8db6
...
@@ -13,8 +13,16 @@
...
@@ -13,8 +13,16 @@
#include "drv_sci.h"
#include "drv_sci.h"
#include "F28x_Project.h"
#include "F28x_Project.h"
extern
rt_uint32_t
rt_thread_switch_interrupt_flag
;
extern
interrupt
void
RTOSINT_Handler
();
extern
interrupt
void
RTOSINT_Handler
();
void
trap_rtosint
()
{
if
(
rt_thread_switch_interrupt_flag
)
asm
(
" trap #16"
);
}
/**
/**
* This is the timer interrupt service routine.
* This is the timer interrupt service routine.
*
*
...
@@ -31,7 +39,7 @@ interrupt void cpu_timer2_isr(void)
...
@@ -31,7 +39,7 @@ interrupt void cpu_timer2_isr(void)
}
}
/**
/**
* This function will initial
STM32
board.
* This function will initial
TMS320F28379D
board.
*/
*/
void
rt_hw_board_init
()
void
rt_hw_board_init
()
{
{
...
@@ -68,4 +76,5 @@ void rt_hw_board_init()
...
@@ -68,4 +76,5 @@ void rt_hw_board_init()
#ifdef RT_USING_CONSOLE
#ifdef RT_USING_CONSOLE
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
rt_console_set_device
(
RT_CONSOLE_DEVICE_NAME
);
#endif
#endif
rt_interrupt_leave_sethook
((
void
(
*
)(
void
))
trap_rtosint
);
}
}
bsp/tms320f28379d/drivers/drv_sci.c
浏览文件 @
4acd8db6
...
@@ -214,7 +214,6 @@ int rt_hw_sci_init(void)
...
@@ -214,7 +214,6 @@ int rt_hw_sci_init(void)
CpuSysRegs
.
PCLKCR7
.
bit
.
SCI_C
=
1
;
CpuSysRegs
.
PCLKCR7
.
bit
.
SCI_C
=
1
;
PieVectTable
.
SCIA_RX_INT
=
&
sciaRxFifoIsr
;
PieVectTable
.
SCIA_RX_INT
=
&
sciaRxFifoIsr
;
//PieVectTable.SCIA_TX_INT = &sciaTxFifoIsr;
EDIS
;
EDIS
;
...
@@ -223,8 +222,7 @@ int rt_hw_sci_init(void)
...
@@ -223,8 +222,7 @@ int rt_hw_sci_init(void)
//
//
PieCtrlRegs
.
PIECTRL
.
bit
.
ENPIE
=
1
;
// Enable the PIE block
PieCtrlRegs
.
PIECTRL
.
bit
.
ENPIE
=
1
;
// Enable the PIE block
PieCtrlRegs
.
PIEIER9
.
bit
.
INTx1
=
1
;
// PIE Group 9, INT1
PieCtrlRegs
.
PIEIER9
.
bit
.
INTx1
=
1
;
// PIE Group 9, INT1
//PieCtrlRegs.PIEIER9.bit.INTx2 = 1; // PIE Group 9, INT2
IER
|=
0x100
;
// Enable CPU INT
IER
=
0x100
;
// Enable CPU INT
EINT
;
EINT
;
struct
serial_configure
config
=
RT_SERIAL_CONFIG_DEFAULT
;
struct
serial_configure
config
=
RT_SERIAL_CONFIG_DEFAULT
;
...
...
libcpu/ti-dsp/c28x/context.s
浏览文件 @
4acd8db6
...
@@ -94,11 +94,10 @@ _rt_hw_interrupt_enable:
...
@@ -94,11 +94,10 @@ _rt_hw_interrupt_enable:
.
asmfunc
.
asmfunc
_rt_hw_context_switch_interrupt
:
_rt_hw_context_switch_interrupt
:
_rt_hw_context_switch
:
MOVL
XAR0
,
#
0
MOVL
XAR0
,
#
0
MOV
AR0
,
AL
MOV
AR0
,
AL
MOVL
XAR4
,
*-
SP
[
4
]
MOVL
XAR4
,
*-
SP
[
4
]
; set rt_thread_switch_interrupt_flag to 1
; set rt_thread_switch_interrupt_flag to 1
MOVL
XAR5
,
#
_rt_thread_switch_interrupt_flag
MOVL
XAR5
,
#
_rt_thread_switch_interrupt_flag
MOVL
XAR6
,
*
XAR5
MOVL
XAR6
,
*
XAR5
MOVL
ACC
,
XAR6
MOVL
ACC
,
XAR6
...
@@ -114,6 +113,37 @@ _reswitch:
...
@@ -114,6 +113,37 @@ _reswitch:
MOVL
XAR5
,
#
_rt_interrupt_to_thread
; set rt_interrupt_to_thread
MOVL
XAR5
,
#
_rt_interrupt_to_thread
; set rt_interrupt_to_thread
MOVL
*
XAR5
,
XAR4
MOVL
*
XAR5
,
XAR4
;TRAP #16
LRETR
.
endasmfunc
;
; void rt_hw_context_switch(rt_uint32 from, rt_uint32 to);
; r0 --> from
; r4 --> to
.
asmfunc
_rt_hw_context_switch
:
MOVL
XAR0
,
#
0
MOV
AR0
,
AL
MOVL
XAR4
,
*-
SP
[
4
]
; set rt_thread_switch_interrupt_flag to 1
MOVL
XAR5
,
#
_rt_thread_switch_interrupt_flag
MOVL
XAR6
,
*
XAR5
MOVL
ACC
,
XAR6
CMPB
AL
,
#
1
B
_reswitch2
,
EQ
MOVL
XAR6
,
#
1
MOVL
*
XAR5
,
XAR6
MOVL
XAR5
,
#
_rt_interrupt_from_thread
; set rt_interrupt_from_thread
MOVL
*
XAR5
,
XAR0
_reswitch2
:
MOVL
XAR5
,
#
_rt_interrupt_to_thread
; set rt_interrupt_to_thread
MOVL
*
XAR5
,
XAR4
TRAP
#
16
TRAP
#
16
LRETR
LRETR
.
endasmfunc
.
endasmfunc
...
@@ -159,9 +189,9 @@ _RTOSINT_Handler:
...
@@ -159,9 +189,9 @@ _RTOSINT_Handler:
;#endif
;#endif
MOV
AL
,
*
AR0
MOV
AL
,
*
AR0
MOV
AR
1
,
AL
MOV
AR
0
,
AL
MOVZ
AR1
,
@
SP
; get from thread stack pointer
MOVZ
AR1
,
@
SP
; get from thread stack pointer
MOV
*
AR0
,
AR1
; update from thread stack pointer
MOV
*
AR0
,
AR1
; update from thread stack pointer
switch_to_thread
:
switch_to_thread
:
MOV
AR1
,
#
_rt_interrupt_to_thread
MOV
AR1
,
#
_rt_interrupt_to_thread
...
@@ -175,7 +205,7 @@ switch_to_thread:
...
@@ -175,7 +205,7 @@ switch_to_thread:
;#endif
;#endif
MOV
@
SP
,
AR1
MOV
@
SP
,
AR1
INC
SP
;
INC SP
RT_CTX_RESTORE
; pop r4 - r11 register
RT_CTX_RESTORE
; pop r4 - r11 register
rtosint_exit
:
rtosint_exit
:
...
...
libcpu/ti-dsp/c28x/cpuport.c
浏览文件 @
4acd8db6
...
@@ -17,6 +17,9 @@ rt_uint32_t rt_thread_switch_interrupt_flag;
...
@@ -17,6 +17,9 @@ rt_uint32_t rt_thread_switch_interrupt_flag;
/* exception hook */
/* exception hook */
static
rt_err_t
(
*
rt_exception_hook
)(
void
*
context
)
=
RT_NULL
;
static
rt_err_t
(
*
rt_exception_hook
)(
void
*
context
)
=
RT_NULL
;
extern
rt_uint16_t
rt_hw_get_st0
(
void
);
extern
rt_uint16_t
rt_hw_get_st1
(
void
);
struct
exception_stack_frame
struct
exception_stack_frame
{
{
rt_uint32_t
t_st0
;
rt_uint32_t
t_st0
;
...
@@ -59,6 +62,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
...
@@ -59,6 +62,7 @@ rt_uint8_t *rt_hw_stack_init(void *tentry,
stk
=
stack_addr
;
stk
=
stack_addr
;
stk
=
(
rt_uint8_t
*
)
RT_ALIGN
((
rt_uint32_t
)
stk
,
8
);
stk
=
(
rt_uint8_t
*
)
RT_ALIGN
((
rt_uint32_t
)
stk
,
8
);
//stk -= sizeof(struct stack_frame);
//stk -= sizeof(struct stack_frame);
stk
+=
1
;
stack_frame
=
(
struct
stack_frame
*
)
stk
;
stack_frame
=
(
struct
stack_frame
*
)
stk
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录