📄 ex_init4.c
字号:
/*
* pico]OS initialization example 4
*
* How to initialize the pico- and the nano- layer.
*
* License: modified BSD, see license.txt in the picoos root directory.
*
*/
#include <picoos.h>
#if POSCFG_ENABLE_NANO == 0
#error This example needs the nano layer!
#endif
/* setup memory for the heap that is managed by the nano layer */
#define HEAPSIZE 0x2000
static char membuf_g[HEAPSIZE];
void *__heap_start = (void*) &membuf_g[0];
void *__heap_end = (void*) &membuf_g[HEAPSIZE-1];
/* function prototype: first task function */
void firsttask(void *arg);
/* Program main function.
* This function starts pico]OS by initializing the nano layer.
*/
int main(void)
{
nosInit(firsttask, /* ptr to function: first task that is executed */
NULL, /* optional argument, not used here */
1, /* priority of the first task */
0, /* stack size for the first task, 0 = default */
0); /* stack size for the idle task, 0 = default */
/* Note: The call to nosInit() will never return */
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -