{"id":683,"date":"2024-08-13T17:54:38","date_gmt":"2024-08-13T09:54:38","guid":{"rendered":"http:\/\/8.153.64.192\/?page_id=683"},"modified":"2024-08-16T14:18:32","modified_gmt":"2024-08-16T06:18:32","slug":"ag32%e4%b8%8b%e4%bd%bf%e7%94%a8os%e7%9a%84%e5%8f%82%e8%80%83","status":"publish","type":"page","link":"http:\/\/www.agm-support.com.cn\/index.php\/%e8%b5%84%e6%ba%90%e4%b8%8b%e8%bd%bd\/ag32%e4%b8%8b%e4%bd%bf%e7%94%a8os%e7%9a%84%e5%8f%82%e8%80%83\/","title":{"rendered":"AG32\u4e0b\u4f7f\u7528os\u7684\u53c2\u8003"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E4%BD%BF%E7%94%A8FreeRTOS\"><\/span>\u4e00\u3001\u4f7f\u7528FreeRTOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5728SDK\u4e0b\u5df2\u7ecf\u6709\u79fb\u690d\u597d\u7684FreeRTOS Kernel V10.4.6 \u7248\u672c\uff0c\u53ef\u4f9b\u7528\u6237\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u6e90\u7801\u4f4d\u4e8e\uff1a\\AgRV_pio\\packages\\framework-agrv_freertos\\<\/p>\n\n\n\n<p>\u7528\u6237\u4f7f\u7528\u65f6\uff0c\u4e0d\u5fc5\u5173\u6ce8\u8be5\u6e90\u7801\uff0c\u53ea\u9700\u5173\u6ce8API\u4f7f\u7528\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E7%AE%80%E5%8D%95%E9%AA%8C%E8%AF%81%EF%BC%9A\"><\/span><strong>1. \u7b80\u5355\u9a8c\u8bc1\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u4f7f\u7528\u65f6\uff0c\u4eceVSCODE\u4e2d\u76f4\u63a5\u6253\u5f00\u5de5\u7a0b\uff1a\\AgRV_pio\\platforms\\AgRV\\examples\\freeRTOS<\/p>\n\n\n\n<p>\u6253\u5f00\u5de5\u7a0b\u540e\uff0c\u53ef\u4ee5\u5148\u9a8c\u8bc1\u7b80\u5355\u7684\u8fd0\u884c\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u5de5\u7a0b\u4e2d\uff0c\u5e76\u6ca1\u6709ve\u6587\u4ef6\uff08\u800c\u662f\u4f7f\u7528\u4e86\u9ed8\u8ba4\u7684ve\u6587\u4ef6\uff09\u3002<\/p>\n\n\n\n<p>\u4fbf\u4e8e\u540e\u7eed\u5f00\u53d1\uff0c\u53ef\u4ee5\u5148\u5efa\u7acb\u4e00\u4efdve\u3002<\/p>\n\n\n\n<p>\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4eceexample\u8def\u5f84\u4e0bcopy\u4e00\u4efd example_board.ve \u8fc7\u6765\uff1b<\/li>\n\n\n\n<li>\u6253\u5f00\u8be5example_board.ve\uff0c\u5220\u9664\u6389\u91cc\u8fb9\u9664clk\u548cled\u706f\u4ee5\u5916\u7684\u5176\u4ed6\u5f15\u811a\u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>\u5728platformio.ini\u4e2d\u6dfb\u52a0\u5bf9\u8be5ve\u7684\u5f15\u7528\uff1aboard_logic.ve = example_board.ve<\/li>\n<\/ol>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u7f16\u8bd1ve\u5e76\u70e7\u5f55\uff0c\u7136\u540e\u7f16\u8bd1code\u5e76\u70e7\u5f55\u3002<\/p>\n\n\n\n<p>\u4e24\u9879\u90fd\u70e7\u5f55\u6210\u529f\u540e\uff0c\u5c31\u53ef\u4ee5\u770b\u5230led\u706f\u7684\u95ea\u70c1\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B%EF%BC%9A\"><\/span>2. <strong>\u4f7f\u7528\u6837\u4f8b\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u6253\u5f00main.c\uff0c\u53ef\u4ee5\u770b\u5230\u5728main\u51fd\u6570\u4e2d\u4f7f\u7528\u4e86\u51e0\u79cd\u5143\u7d20\uff1axQueue\u3001xSemaphore\u3001xTask\u3001xTimer\u3002<\/p>\n\n\n\n<p>\u540c\u65f6\u5728main.c\u4e2d\u5bf9\u63a5\u7684hook\u56de\u8c03\u4e2d\uff0c\u4f1a\u914d\u5408\u4f7f\u7528\u8fd9\u4e9b\u5143\u7d20\u3002<\/p>\n\n\n\n<p><strong>\u8fd9\u91cc\u6ce8\u610f\uff0c\u5982\u679c\u8981\u7cbe\u7b80\u6837\u4f8b\uff0c\u6bd4\u5982\u53ea\u8dd1\u4e00\u4e2atask\u65f6\uff0c\u5220\u9664\u5176\u4ed6\u5143\u7d20\u65f6\uff0c\u8981\u540c\u65f6\u628ahook\u91cc\u5bf9\u5e94\u7684\u8c03\u7528\u4e5f\u5220\u9664\u3002<\/strong><strong><\/strong><\/p>\n\n\n\n<p>main() \u51fd\u6570\u4e2d\uff0c\u53ef\u7cbe\u7b80\u5230\u8c03\u75283\u4e2a\u51fd\u6570\uff1a<\/p>\n\n\n\n<p>int main(void)<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>    prvSetupHardware();<\/p>\n\n\n\n<p>    xTaskCreate(led_task,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"led_task\",<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;configMINIMAL_STACK_SIZE,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mainEVENT_SEMAPHORE_TASK_PRIORITY,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;xGPTimerTask);<\/p>\n\n\n\n<p>    vTaskStartScheduler();<\/p>\n\n\n\n<p>    for(;;);<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>\u5176\u4e2d\uff0cprvSetupHardware()\u51fd\u6570\u4e2d\u6709init\u51fd\u6570\u662f\u5fc5\u987b\u7684\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"544\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-156.png\" alt=\"\" class=\"wp-image-686\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-156.png 936w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-156-300x174.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-156-768x446.png 768w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/figure>\n\n\n\n<p>\u5728led_task\u4e2d\u53ef\u5199\u95ea\u706f\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"329\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-157.png\" alt=\"\" class=\"wp-image-687\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-157.png 876w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-157-300x113.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-157-768x288.png 768w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><\/figure>\n\n\n\n<p>\u53e6\u5916\uff0c\u7531\u4e8e\u4e0d\u518d\u4f7f\u7528xEventSemaphore\uff0c\u4e5f\u9700\u8981\u5728vApplicationTickHook\u4e2d\u53bb\u9664\u5bf9xSemaphore\u7684\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"135\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-158.png\" alt=\"\" class=\"wp-image-688\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-158.png 845w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-158-300x48.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-158-768x123.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/figure>\n\n\n\n<p>\u53ef\u5c1d\u8bd5\u7f16\u8bd1\u8fd0\u884c\uff0c\u67e5\u770b\u6548\u679c\u3002<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<p>\u9664\u4e86\u4ee5\u4e0a\u7b80\u5316\u8fc7\u7a0b\uff0c\u8fd8\u6709\u7528\u6237\u4f1a\u4f7f\u7528\u5230<strong>freeRTOS\u7684\u9759\u6001\u65b9\u6cd5<\/strong>\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4f7f\u7528\u9759\u6001\u65b9\u6cd5\uff0c\u5373\u6253\u5f00\u4e86\u5b8f\uff1aconfigSUPPORT_STATIC_ALLOCATION\uff0c\u9700\u8981\u65b0\u589e\u4e24\u4e2ahook\u51fd\u6570\uff0c\u53ef\u53c2\u8003\uff1a<a href=\"https:\/\/blog.csdn.net\/m0_46451722\/article\/details\/113053257\"><u>https:\/\/blog.csdn.net\/m0_46451722\/article\/details\/113053257<\/u><\/a>&nbsp;\u4e2d\u7684\u63cf\u8ff0\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u5982\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"907\" height=\"420\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-159.png\" alt=\"\" class=\"wp-image-689\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-159.png 907w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-159-300x139.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-159-768x356.png 768w\" sizes=\"auto, (max-width: 907px) 100vw, 907px\" \/><\/figure>\n\n\n\n<p>\u7f16\u8bd1\u901a\u8fc7\u540e\uff0c\u53ef\u5728\u51fd\u6570\u4e2d\u4f7f\u7528 static\u90a3\u7ec4\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u7528\u6cd5\u548c\u52a8\u6001\u90a3\u7ec4\u51fd\u6570\u76f8\u4f3c\uff0c\u6ce8\u610f\u53c2\u6570\u4f7f\u7528\u9759\u6001\u5206\u914d\u597d\u7684\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E7%A8%8B%EF%BC%9A\"><\/span>3. <strong>\u4f7f\u7528\u81ea\u5efa\u5de5\u7a0b\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5982\u679c\u7528\u6237\u5e0c\u671b\u5728\u81ea\u5efa\u5de5\u7a0b\u4e2d\u4f7f\u7528freeRTOS\uff0c\u8be5\u5982\u4f55\u628a\u5b83\u6dfb\u52a0\u8fdb\u6765\uff1f<\/p>\n\n\n\n<p>\u6bd4\u5982\uff0c\u5728example\u4e0b\u8981\u628afreeRTOS\u52a0\u8fdb\u6765\u3002\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<p>1. \u5728platformio.ini\u4e2d\u589e\u52a0\u5bf9freertos\u7684\u5f15\u7528\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"116\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-160.png\" alt=\"\" class=\"wp-image-692\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-160.png 862w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-160-300x40.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-160-768x103.png 768w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/figure>\n\n\n\n<p>\u6ce8\u610f\uff0c\u591a\u4e2a\u5e93\u4e4b\u95f4\u7528\u201c\u9017\u53f7+\u7a7a\u683c\u201d\u6765\u9694\u5f00\u3002<\/p>\n\n\n\n<p>2. \u786e\u8ba4ve\u6587\u4ef6\u91cc\u7684\u914d\u7f6e\u6b63\u5e38\uff08\u65f6\u949f+led\u5f15\u811a\uff09\uff1b<\/p>\n\n\n\n<p>3. \u5728example.c\u4e2d\u5f15\u5165freertos\u7684\u5934\u6587\u4ef6\u53ca\u7528\u5230\u7684\u5b8f\u5b9a\u4e49\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"400\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-161.png\" alt=\"\" class=\"wp-image-695\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-161.png 845w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-161-300x142.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-161-768x364.png 768w\" sizes=\"auto, (max-width: 845px) 100vw, 845px\" \/><\/figure>\n\n\n\n<p>4. \u5728example.c\u4e2d\u65b0\u589e\u51e0\u4e2a\u51fd\u6570\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"362\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-162.png\" alt=\"\" class=\"wp-image-697\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-162.png 844w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-162-300x129.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-162-768x329.png 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" \/><\/figure>\n\n\n\n<p>5. \u5728main.c\u4e2dinit\u540e\u76f4\u63a5\u542f\u52a8freeRTOS\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"906\" height=\"399\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-163.png\" alt=\"\" class=\"wp-image-699\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-163.png 906w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-163-300x132.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-163-768x338.png 768w\" sizes=\"auto, (max-width: 906px) 100vw, 906px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\uff0c\u7f16\u8bd1ve\u5e76\u70e7\u5f55\uff0c\u518d\u7f16\u8bd1code\u5e76\u70e7\u5f55\uff0c\u5c31\u53ef\u4ee5\u770b\u5230led\u7684\u95ea\u70c1\u4e86\u3002<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81%E4%BD%BF%E7%94%A8uCOS\"><\/span>\u4e8c\u3001\u4f7f\u7528uCOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5728SDK\u4e0b\u5df2\u7ecf\u6709\u79fb\u690d\u597d\u7684uC\/OS-III V3.08.01 \u7248\u672c\uff0c\u53ef\u4f9b\u7528\u6237\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>\u6e90\u7801\u4f4d\u4e8e\uff1a\\AgRV_pio\\packages\\framework-agrv_ucos\\<\/p>\n\n\n\n<p>\u7528\u6237\u4f7f\u7528\u65f6\uff0c\u4e0d\u5fc5\u5173\u6ce8\u8be5\u6e90\u7801\uff0c\u53ea\u9700\u5173\u6ce8API\u4f7f\u7528\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E7%AE%80%E5%8D%95%E9%AA%8C%E8%AF%81%EF%BC%9A-2\"><\/span><strong>1. \u7b80\u5355\u9a8c\u8bc1\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u4f7f\u7528\u65f6\uff0c\u4eceVSCODE\u4e2d\u76f4\u63a5\u6253\u5f00\u5de5\u7a0b\uff1a\\AgRV_pio\\platforms\\AgRV\\examples\\uCOS<\/p>\n\n\n\n<p>\u6253\u5f00\u5de5\u7a0b\u540e\uff0c\u53ef\u4ee5\u5148\u9a8c\u8bc1\u7b80\u5355\u7684\u8fd0\u884c\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u5de5\u7a0b\u4e2d\uff0c\u5e76\u6ca1\u6709ve\u6587\u4ef6\uff08\u800c\u662f\u4f7f\u7528\u4e86\u9ed8\u8ba4\u7684ve\u6587\u4ef6\uff09\u3002<\/p>\n\n\n\n<p>\u4fbf\u4e8e\u540e\u7eed\u5f00\u53d1\uff0c\u53ef\u4ee5\u5148\u5efa\u7acb\u4e00\u4efdve\u3002<\/p>\n\n\n\n<p>\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4eceexample\u8def\u5f84\u4e0bcopy\u4e00\u4efd example_board.ve \u8fc7\u6765\uff0c\u91cd\u547d\u540d\u4e3auCOS_board.ve\uff1b<\/li>\n\n\n\n<li>\u6253\u5f00\u8be5uCOS_board.ve\uff0c\u5220\u9664\u6389\u91cc\u8fb9\u9664clk\u548cled\u706f\u4ee5\u5916\u7684\u5176\u4ed6\u5f15\u811a\u914d\u7f6e\uff1b<\/li>\n\n\n\n<li>\u5728platformio.ini\u4e2d\u6dfb\u52a0\u5bf9\u8be5ve\u7684\u5f15\u7528\uff1aboard_logic.ve = uCOS_board.ve<\/li>\n<\/ol>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u7f16\u8bd1ve\u5e76\u70e7\u5f55\uff0c\u7136\u540e\u7f16\u8bd1code\u5e76\u70e7\u5f55\u3002<\/p>\n\n\n\n<p>\u4e24\u9879\u90fd\u70e7\u5f55\u6210\u529f\u540e\uff0c\u5c31\u53ef\u4ee5\u770b\u5230led\u706f\u7684\u95ea\u70c1\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B%EF%BC%9A-2\"><\/span>2. <strong>\u4f7f\u7528\u6837\u4f8b\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u6253\u5f00main.c\uff0c\u53ef\u4ee5\u770b\u5230\u4f8b\u7a0b\u4e2d\u5c55\u793a\u4e86\u51e0\u79cd\u5143\u7d20\u7684\u4f7f\u7528\u65b9\u6cd5\uff1aSemaphore\u3001Queue\u3001Task\u3001Timer\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7b80\u5316\u6837\u4f8b\u65f6\uff0c\u6bd4\u5982\u53ea\u4fdd\u7559\u4e00\u4e2aTask\uff1aAppTaskTimer\uff0c\u5219\u6ce8\u6389\u5176\u4ed6task\u7684\u521b\u5efa\u5373\u53ef\u3002<\/p>\n\n\n\n<p>uC\/OS\u7684\u6837\u4f8b\u8f83\u4e3a\u7b80\u5355\uff0c\u81ea\u884c\u5c1d\u8bd5\u5373\u53ef\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E4%BD%BF%E7%94%A8%E8%87%AA%E5%BB%BA%E5%B7%A5%E7%A8%8B%EF%BC%9A-2\"><\/span>3. <strong>\u4f7f\u7528\u81ea\u5efa\u5de5\u7a0b\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5982\u679c\u7528\u6237\u5e0c\u671b\u5728\u81ea\u5efa\u5de5\u7a0b\u4e2d\u4f7f\u7528uC\/OS\uff0c\u8be5\u5982\u4f55\u628a\u5b83\u6dfb\u52a0\u8fdb\u6765\uff1f<\/p>\n\n\n\n<p>\u6bd4\u5982\uff0c\u5728example\u4e0b\u8981\u628auC\/OS\u52a0\u8fdb\u6765\u3002\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<p>1. \u5728platformio.ini\u4e2d\u589e\u52a0\u5bf9uC\/OS\u7684\u5f15\u7528\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"95\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-164.png\" alt=\"\" class=\"wp-image-706\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-164.png 824w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-164-300x35.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-164-768x89.png 768w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/figure>\n\n\n\n<p>\u6ce8\u610f\uff0c\u591a\u4e2a\u5e93\u4e4b\u95f4\u7528\u201c\u9017\u53f7+\u7a7a\u683c\u201d\u6765\u9694\u5f00\u3002<\/p>\n\n\n\n<p>2. \u786e\u8ba4ve\u6587\u4ef6\u91cc\u7684\u914d\u7f6e\u6b63\u5e38\uff08\u65f6\u949f+led\u5f15\u811a\uff09\uff1b<\/p>\n\n\n\n<p>3. \u5c06\u7528\u5230\u7684\u51e0\u4e2a\u5934\u6587\u4ef6\u4eceuCOS\u5de5\u7a0b\u4e0bcopy\u8fc7\u6765\uff1b<\/p>\n\n\n\n<p>4. \u5728example.c\u4e2d\u5f15\u5165freertos\u7684\u5934\u6587\u4ef6\u53ca\u7528\u5230\u7684\u5b8f\u5b9a\u4e49\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"344\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-165.png\" alt=\"\" class=\"wp-image-708\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-165.png 902w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-165-300x114.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-165-768x293.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/figure>\n\n\n\n<p>5. \u5728example.c\u4e2d\u65b0\u589e\u51e0\u4e2a\u51fd\u6570\uff08\u4eceuCOS\u7684\u4f8b\u7a0b\u4e2d\u7b80\u5316\u8fc7\u6765\u7684\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"595\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-166.png\" alt=\"\" class=\"wp-image-710\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-166.png 877w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-166-300x204.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-166-768x521.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\" \/><\/figure>\n\n\n\n<p>6. \u5728main.c\u4e2d\u4fdd\u7559uCOS\u7684\u542f\u52a8\u5373\u53ef\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"869\" height=\"401\" src=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-167.png\" alt=\"\" class=\"wp-image-712\" srcset=\"http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-167.png 869w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-167-300x138.png 300w, http:\/\/www.agm-support.com.cn\/wp-content\/uploads\/2024\/08\/image-167-768x354.png 768w\" sizes=\"auto, (max-width: 869px) 100vw, 869px\" \/><\/figure>\n\n\n\n<p>\u7136\u540e\uff0c\u7f16\u8bd1ve\u5e76\u70e7\u5f55\uff0c\u518d\u7f16\u8bd1code\u5e76\u70e7\u5f55\uff0c\u5c31\u53ef\u4ee5\u770b\u5230led\u7684\u95ea\u70c1\u4e86\u3002<\/p>\n\n\n\n<p>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%89%E3%80%81%E5%85%B6%E4%BB%96%E7%B3%BB%E7%BB%9F\"><\/span>\u4e09\u3001\u5176\u4ed6\u7cfb\u7edf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5176\u4ed6\u7cfb\u7edf\u4e0d\u518d\u4e3e\u4f8b\u3002<\/p>\n\n\n\n<p>\u53c2\u8003\u4e0a\u8fb9\u7684\u4e24\u4e2a\uff0c\u81ea\u884c\u5efa\u7acb\u5bf9\u5e94\u7684\u7cfb\u7edf\u5373\u53ef\u3002<\/p>\n\n\n\n<p>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u4f7f\u7528FreeRTOS \u5728SDK\u4e0b\u5df2\u7ecf\u6709\u79fb\u690d\u597d\u7684FreeRTOS Kernel V10.4.6 \u7248\u672c\uff0c\u53ef\u4f9b\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":431,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","footnotes":""},"class_list":["post-683","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/pages\/683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=683"}],"version-history":[{"count":18,"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/pages\/683\/revisions"}],"predecessor-version":[{"id":713,"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/pages\/683\/revisions\/713"}],"up":[{"embeddable":true,"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/pages\/431"}],"wp:attachment":[{"href":"http:\/\/www.agm-support.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}