Read about our upcoming Code of Conduct on this issue

Commit 47807365 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

Tasks: new method for checking whether an interrupt is active

(old method was not compatible with DIGIC 7; to be tested on all models)

--HG--
branch : new-dryos-task-hooks
parent ba97711fa839
......@@ -106,11 +106,17 @@ copy_and_restart( int offset )
char* get_current_task_name()
{
#if 0
/* DryOS: right after current_task we have a flag
* set to 1 when handling an interrupt */
/* this doesn't work on DIGIC 7 */
uint32_t interrupt_active = MEM((uintptr_t)&current_task + 4);
if (!interrupt_active)
#endif
/* DryOS: right before interrupt_active we have a counter showing the interrupt nesting level */
uint32_t interrupt_level = MEM((uintptr_t)&current_interrupt - 4);
if (!interrupt_level)
{
return current_task->name;
}
......
......@@ -22,11 +22,10 @@ int ml_shutdown_requested = 0;
char* get_current_task_name()
{
/* DryOS: right after current_task we have a flag
* set to 1 when handling an interrupt */
uint32_t interrupt_active = MEM((uintptr_t)&current_task + 4);
if (!interrupt_active)
/* DryOS: right before interrupt_active we have a counter showing the interrupt nesting level */
uint32_t interrupt_level = MEM((uintptr_t)&current_interrupt - 4);
if (!interrupt_level)
{
return current_task->name;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment