Browse Source

Implement automatic task termination

DricomDragon 5 years ago
parent
commit
3ce255e511
1 changed files with 3 additions and 0 deletions
  1. 3 0
      prog/sources/xtr.cpp

+ 3 - 0
prog/sources/xtr.cpp

@@ -109,6 +109,9 @@ static void kernel_set_task_context (INIT_MODE_
 
 	// Initialize CPSR
 	ptr->mXPSR = 1 << 24 ; // Thumb bit
+
+	// Self termination
+	ptr->mLR = (uint32_t) taskSelfTerminates;
 }
 
 // T A S K    C O N T R O L    B L O C K                                                                             *