@@ -97,8 +97,9 @@ static MMRESULT OSTick_TimerID;
97
97
/*
98
98
* flag in interrupt handling
99
99
*/
100
- rt_uint32_t rt_interrupt_from_thread , rt_interrupt_to_thread ;
101
- rt_uint32_t rt_thread_switch_interrupt_flag ;
100
+ volatile rt_ubase_t rt_interrupt_from_thread = 0 ;
101
+ volatile rt_ubase_t rt_interrupt_to_thread = 0 ;
102
+ volatile rt_uint32_t rt_thread_switch_interrupt_flag = 0 ;
102
103
103
104
/*
104
105
*********************************************************************************************************
@@ -248,18 +249,17 @@ void rt_hw_interrupt_enable(rt_base_t level)
248
249
* Note(s) : none
249
250
*********************************************************************************************************
250
251
*/
251
- void rt_hw_context_switch_interrupt (rt_uint32_t from ,
252
- rt_uint32_t to )
252
+ void rt_hw_context_switch_interrupt (rt_ubase_t from , rt_ubase_t to , rt_thread_t from_thread , rt_thread_t to_thread )
253
253
{
254
254
if (rt_thread_switch_interrupt_flag != 1 )
255
255
{
256
256
rt_thread_switch_interrupt_flag = 1 ;
257
257
258
258
// set rt_interrupt_from_thread
259
- rt_interrupt_from_thread = * (( rt_uint32_t * )( from )) ;
259
+ rt_interrupt_from_thread = from ;
260
260
}
261
261
262
- rt_interrupt_to_thread = * (( rt_uint32_t * )( to )) ;
262
+ rt_interrupt_to_thread = to ;
263
263
264
264
//trigger YIELD exception(cause context switch)
265
265
TriggerSimulateInterrupt (CPU_INTERRUPT_YIELD );
0 commit comments