Skip to content

Commit 130b5ba

Browse files
ComerLaterRbb666
authored andcommitted
解决rt_hw_context_switch_interrupt形参定义不一致
Signed-off-by: latercomer <[email protected]>
1 parent 9e13f67 commit 130b5ba

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

bsp/simulator/template_vs2012.vcxproj

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
4646
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
4747
<LanguageStandard_C>stdc11</LanguageStandard_C>
48+
<TreatSpecificWarningsAsErrors>4029</TreatSpecificWarningsAsErrors>
4849
</ClCompile>
4950
<Link>
5051
<AdditionalDependencies>winmm.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>

libcpu/sim/win32/cpu_port.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ static MMRESULT OSTick_TimerID;
9797
/*
9898
* flag in interrupt handling
9999
*/
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;
102103

103104
/*
104105
*********************************************************************************************************
@@ -248,18 +249,17 @@ void rt_hw_interrupt_enable(rt_base_t level)
248249
* Note(s) : none
249250
*********************************************************************************************************
250251
*/
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)
253253
{
254254
if(rt_thread_switch_interrupt_flag != 1)
255255
{
256256
rt_thread_switch_interrupt_flag = 1;
257257

258258
// set rt_interrupt_from_thread
259-
rt_interrupt_from_thread = *((rt_uint32_t *)(from));
259+
rt_interrupt_from_thread = from;
260260
}
261261

262-
rt_interrupt_to_thread = *((rt_uint32_t *)(to));
262+
rt_interrupt_to_thread = to;
263263

264264
//trigger YIELD exception(cause context switch)
265265
TriggerSimulateInterrupt(CPU_INTERRUPT_YIELD);

0 commit comments

Comments
 (0)