25
CHAPTER 4
Thread-Local Storage TLS
OS_TASK_Delay(
50
);
}
}
static
void
LPTask(
void
) {
OS_TASK_SetContextExtensionTLS();
while
(
1
) {
errno =
1
;
// errno specific to LPTask
OS_TASK_Delay(
200
);
}
}
int
main(
void
) {
errno =
0
;
// errno not specific to any task
OS_Init();
// Initialize embOS
OS_InitHW();
// Initialize required hardware
OS_TASK_CREATE(&TCBHP,
"HP Task"
,
100
, HPTask, StackHP);
OS_TASK_CREATE(&TCBLP,
"LP Task"
,
50
, LPTask, StackLP);
OS_Start();
// Start embOS
return
0
;
}
embOS-MPU for Cortex-M and IAR
© 2010-2020 SEGGER Microcontroller GmbH