MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_context_switch_to

Function rt_hw_context_switch_to

libcpu/rx/cpuport.c:184–201  ·  view source on GitHub ↗

* switch to the first thread,it just call one time * * @author LXZ (2014/11/8) * * @param rt_uint32_t to */

Source from the content-addressed store, hash-verified

182 * @param rt_uint32_t to
183 */
184void rt_hw_context_switch_to(rt_uint32_t to)
185{
186
187 rt_interrupt_from_thread = 0;
188 rt_interrupt_to_thread = to;
189 rt_thread_switch_interrupt_flag = 1;
190 /* enable interrupt*/
191 _IEN( _ICU_SWINT ) = 1;
192
193 /*clear the interrupt flag*/
194 _IR( _ICU_SWINT ) = 0;
195 _IPR( _ICU_SWINT ) = MAX_SYSCALL_INTERRUPT_PRIORITY + 1;
196
197 /*touch the software interrupt*/
198 ENTER_INTERRUPT();
199 /*wait for first thread start up*/
200 while(1);
201}
202

Callers 3

_signal_entryFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected