{"id":1619,"date":"2025-03-19T16:03:30","date_gmt":"2025-03-19T08:03:30","guid":{"rendered":"https:\/\/aoofoo.com\/?p=1619"},"modified":"2025-03-20T17:55:55","modified_gmt":"2025-03-20T09:55:55","slug":"freertos%e5%88%97%e8%a1%a8%e5%92%8c%e5%88%97%e8%a1%a8%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/aoofoo.com\/index.php\/2025\/03\/19\/freertos%e5%88%97%e8%a1%a8%e5%92%8c%e5%88%97%e8%a1%a8%e9%a1%b9\/","title":{"rendered":"3.8 FreeRTOS\u5217\u8868\u548c\u5217\u8868\u9879"},"content":{"rendered":"<h2>\u5217\u8868\u548c\u5217\u8868\u9879\u7b80\u4ecb<\/h2>\n<p>FreeRTOS\u4e2d\uff0c\u5217\u8868\u662f\u975e\u5e38<span style=\"color: #ff6600;\"><strong>\u91cd\u8981<\/strong><\/span>\u7684\uff01\u60f3\u8981\u770b\u61c2FreeRTOS\u7684\u6e90\u7801\uff0c\u5b66\u4f1a\u5217\u8868\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n<p><span style=\"color: #ff6600;\"><strong>\u5217\u8868<\/strong><\/span>\u662f FreeRTOS \u4e2d\u7684\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\uff0c\u6982\u5ff5\u4e0a\u548c\u94fe\u8868\u6709\u70b9\u7c7b\u4f3c\uff0c\u5217\u8868\u88ab\u7528\u6765\u8ddf\u8e2a FreeRTOS\u4e2d\u7684\u4efb\u52a1\u3002<\/p>\n<p><span style=\"color: #ff6600;\"><strong>\u5217\u8868\u9879<\/strong><\/span>\u5c31\u662f\u5b58\u653e\u5728\u5217\u8868\u4e2d\u7684\u9879\u76ee\u3002<\/p>\n<p>\u6211\u4eec\u770b\u4e0b\u56fe\uff0c\u53ef\u4ee5\u660e\u663e\u7684\u611f\u53d7\u5230\uff0c\u5217\u8868\u5c31\u662f\u5faa\u73af\u53cc\u5411\u94fe\u8868\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1623\" src=\"https:\/\/aoofoo.com\/wp-content\/uploads\/2025\/03\/\u5c4f\u5e55\u622a\u56fe-2025-03-19-161336.png\" alt=\"\" width=\"718\" height=\"318\" \/><\/p>\n<p>\u5217\u8868\u7684\u7279\u70b9\uff1a\u5217\u8868\u9879\u95f4\u7684\u5730\u5740\u975e\u8fde\u7eed\u7684\uff0c\u662f\u4eba\u4e3a\u7684\u8fde\u63a5\u5230\u4e00\u8d77\u7684\u3002\u5217\u8868\u9879\u7684\u6570\u76ee\u662f\u7531\u540e\u671f\u6dfb\u52a0\u7684\u4e2a\u6570\u51b3\u5b9a\u7684\uff0c\u968f\u65f6\u53ef\u4ee5\u6539\u53d8\u3002<\/p>\n<p>\u6570\u7ec4\u7684\u7279\u70b9\uff1a\u6570\u7ec4\u6210\u5458\u5730\u5740\u662f\u8fde\u7eed\u7684\uff0c\u6570\u7ec4\u5728\u6700\u521d\u786e\u5b9a\u4e86\u6210\u5458\u6570\u91cf\u540e\u671f\u65e0\u6cd5\u6539\u53d8\u3002<\/p>\n<p>\u5728OS\u4e2d\u4efb\u52a1\u7684\u6570\u91cf\u662f\u4e0d\u786e\u5b9a\u7684\uff0c\u5e76\u4e14\u4efb\u52a1\u72b6\u6001\u662f\u4f1a\u53d1\u751f\u6539\u53d8\u7684\uff0c\u6240\u4ee5\u975e\u5e38\u9002\u7528\u94fe\u8868\u8fd9\u79cd\u6570\u636e\u7ed3\u6784\u3002<\/p>\n<p>\u6709\u5173\u4e8e\u5217\u8868\u7684\u4e1c\u897f\u5747\u5728\u6587\u4ef6 list.c \u548c list.h \u4e2d\uff0c\u9996\u5148\u6211\u4eec\u5148\u770b\u4e0b\u5728list.h\u4e2d\u7684\uff0c\u5217\u8868\u76f8\u5173\u7ed3\u6784\u4f53\uff1a<\/p>\n<p>\u2460List_t\u7ed3\u6784\u4f53\uff1a<\/p>\n<pre class=\"corepress-code-pre\"><code>typedef struct xLIST\r\n{\r\n    \tlistFIRST_LIST_INTEGRITY_CHECK_VALUE\t\t\t\/* \u6821\u9a8c\u503c *\/\r\n    \tvolatile UBaseType_t uxNumberOfItems;\t\t\t\/* \u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\u6570\u91cf *\/\r\n   \tListItem_t * configLIST_VOLATILE pxIndex\t\t\t\/* \u7528\u4e8e\u904d\u5386\u5217\u8868\u9879\u7684\u6307\u9488 *\/\r\n    \tMiniListItem_t xListEnd\t\t\t\t\t\/* \u672b\u5c3e\u5217\u8868\u9879 *\/\r\n    \tlistSECOND_LIST_INTEGRITY_CHECK_VALUE\t\t\/* \u6821\u9a8c\u503c *\/\r\n} List_t;\r\n<\/code><\/pre>\n<p>1\u3001\u6211\u4eec\u53d1\u73b0\u6709\u4e24\u4e2a\u5b8f\uff0c\u5206\u522b\u662f\uff1a<\/p>\n<p><code>listFIRST_LIST_INTEGRITY_CHECK_VALUE<\/code><\/p>\n<p><code>listSECOND_LIST_INTEGRITY_CHECK_VALUE<\/code><\/p>\n<p>\u8fd9\u4e24\u4e2a\u5b8f\u662f\u786e\u5b9a\u7684\u5df2\u77e5\u5e38\u91cf\uff0c FreeRTOS\u901a\u8fc7\u68c0\u67e5\u8fd9\u4e24\u4e2a\u5e38\u91cf\u7684\u503c\uff0c \u6765\u5224\u65ad\u5217\u8868\u7684\u6570\u636e\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u662f\u5426\u906d\u5230\u7834\u574f \uff0c\u8be5\u529f\u80fd\u4e00\u822c\u7528\u4e8e\u8c03\u8bd5\uff0c \u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c<span style=\"color: #ff6600;\"><strong>\u6240\u4ee5\u8fd9\u4e24\u4e2a\u5b8f\uff0c\u6211\u4eec\u65e0\u9700\u5173\u6ce8\uff0c\u4ee5\u540e\u5728\u5176\u4ed6\u7ed3\u6784\u4f53\u4e2d\u4e5f\u65e0\u9700\u5173\u6ce8<\/strong><\/span>\uff0c\u6ca1\u5565\u7528\u3002<\/p>\n<p>2\u3001\u6210\u5458uxNumberOfItems\uff0c\u7528\u4e8e\u8bb0\u5f55\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u4e2a\u6570\uff08\u4e0d\u5305\u542b\u672b\u5c3e\u5217\u8868\u9879xListEnd\uff09\u3002<\/p>\n<p>3\u3001\u6210\u5458 pxIndex \u7528\u4e8e\u6307\u5411\u5217\u8868\u4e2d\u7684\u67d0\u4e2a<span style=\"color: #ff6600;\">\u5217\u8868\u9879<\/span>\uff0c\u4e00\u822c\u7528\u4e8e\u904d\u5386\u5217\u8868\u4e2d\u7684\u6240\u6709\u5217\u8868\u9879 \u3002<\/p>\n<p>4\u3001\u6210\u5458\u53d8\u91cf xListEnd \u662f\u4e00\u4e2a\u8ff7\u4f60\u5217\u8868\u9879\uff0c\u603b\u662f\u6392\u5728\u6700\u672b\u5c3e \u3002<\/p>\n<p>\u2461xLIST_ITEM\u7ed3\u6784\u4f53\uff1a<\/p>\n<pre class=\"corepress-code-pre\"><code>struct xLIST_ITEM\r\n{\r\n    \tlistFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE\t\t\t\/* \u7528\u4e8e\u68c0\u6d4b\u5217\u8868\u9879\u7684\u6570\u636e\u5b8c\u6574\u6027 *\/\r\n    \tconfigLIST_VOLATILE TickType_t xItemValue\t\t\t\t\/* \u5217\u8868\u9879\u7684\u503c *\/\r\n     \tstruct xLIST_ITEM * configLIST_VOLATILE pxNext\t\t\/* \u4e0b\u4e00\u4e2a\u5217\u8868\u9879 *\/\r\n  \tstruct xLIST_ITEM * configLIST_VOLATILE pxPrevious\t\t\/* \u4e0a\u4e00\u4e2a\u5217\u8868\u9879 *\/\r\n    \tvoid * pvOwner\t\t\t\t\t\t\t\/* \u5217\u8868\u9879\u7684\u62e5\u6709\u8005 *\/\r\n    \tstruct xLIST * configLIST_VOLATILE pxContainer; \t\t\t\/* \u5217\u8868\u9879\u6240\u5728\u5217\u8868 *\/\r\n   \tlistSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE\t\t\t\/* \u7528\u4e8e\u68c0\u6d4b\u5217\u8868\u9879\u7684\u6570\u636e\u5b8c\u6574\u6027 *\/\r\n};\r\ntypedef struct xLIST_ITEM ListItem_t; <\/code><\/pre>\n<p>1\u3001\u6210\u5458\u53d8\u91cf xItemValue \u4e3a\u5217\u8868\u9879\u7684\u503c\uff0c\u8fd9\u4e2a\u503c\u591a\u7528\u4e8e\u6309\u5347\u5e8f\u5bf9\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\u8fdb\u884c\u6392\u5e8f \u3002<\/p>\n<p>2\u3001\u6210\u5458\u53d8\u91cf pxNext \u548c pxPrevious \u5206\u522b\u7528\u4e8e\u6307\u5411\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u4e0b\u4e00\u4e2a\u5217\u8868\u9879\u548c\u4e0a\u4e00\u4e2a\u5217\u8868\u9879\u3002<\/p>\n<p>3\u3001\u6210\u5458\u53d8\u91cf pxOwner \u7528\u4e8e\u6307\u5411\u5305\u542b\u5217\u8868\u9879\u7684\u5bf9\u8c61\uff0c\u901a\u5e38\u662f<span style=\"color: #ff6600;\"><strong>\u4efb\u52a1\u63a7\u5236\u5757<\/strong><\/span>\u3002<\/p>\n<p>4\u3001\u6210\u5458\u53d8\u91cf pxContainer \u7528\u4e8e\u6307\u5411\u5217\u8868\u9879\u6240\u5728\u5217\u8868(\u5c31\u5e8f\u5217\u8868\u3001\u963b\u585e\u5217\u8868\u3001\u6302\u8d77\u5217\u8868)\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u2462xMINI_LIST_ITEM\u7ed3\u6784\u4f53\uff1a<\/p>\n<pre class=\"corepress-code-pre\"><code>struct xMINI_LIST_ITEM\r\n{\r\n    \tlistFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE \t\t\t\/* \u7528\u4e8e\u68c0\u6d4b\u6570\u636e\u5b8c\u6574\u6027 *\/\r\n\tconfigLIST_VOLATILE TickType_t xItemValue;\t\t\t\t\/* \u5217\u8868\u9879\u7684\u503c *\/\r\n    \tstruct xLIST_ITEM * configLIST_VOLATILE pxNext;\t\t\/* \u4e0a\u4e00\u4e2a\u5217\u8868\u9879 *\/\r\n   \tstruct xLIST_ITEM * configLIST_VOLATILE pxPrevious; \t\t\/* \u4e0b\u4e00\u4e2a\u5217\u8868\u9879 *\/\r\n};\r\ntypedef struct xMINI_LIST_ITEM MiniListItem_t;\r\n<\/code><\/pre>\n<p>\u8ff7\u4f60\u5217\u8868\u9879\uff0c\u8ff7\u4f60\u5217\u8868\u9879\u4e5f\u662f\u5217\u8868\u9879\uff0c\u4f46\u8ff7\u4f60\u5217\u8868\u9879\u4ec5\u7528\u4e8e<span style=\"color: #ff6600;\">\u6807\u8bb0\u5217\u8868\u7684\u672b\u5c3e<\/span>\u548c<span style=\"color: #ff6600;\">\u6302\u8f7d\u5176\u4ed6\u63d2\u5165\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879<\/span>\u3002\u6807\u8bb0\u5217\u8868\u7684\u672b\u5c3e\u6211\u4eec\u597d\u7406\u89e3\uff0c\u5c31\u662f\u628a\u8ff7\u4f60\u5217\u8868\u9879\u5f53\u6210\u67d0\u4e2a\u5217\u8868\u7684\u672b\u5c3e\uff0c\u4f46\u662f\u201c\u6302\u8f7d\u5176\u4ed6\u63d2\u5165\u5217\u8868\u7684\u5217\u8868\u9879\u201d\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f\u6211\u4eec\u4e00\u4f1a\u6765\u8bb2\uff0c\u5148\u770b\u7ed3\u6784\u4f53\u6210\u5458\u3002<\/p>\n<p>1\u3001\u6210\u5458\u53d8\u91cf xItemValue \u4e3a\u5217\u8868\u9879\u7684\u503c\uff0c\u8fd9\u4e2a\u503c\u591a\u7528\u4e8e\u6309\u5347\u5e8f\u5bf9\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<p>2\u3001\u6210\u5458\u53d8\u91cf pxNext \u548c pxPrevious \u5206\u522b\u7528\u4e8e\u6307\u5411\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u4e0b\u4e00\u4e2a\u5217\u8868\u9879\u548c\u4e0a\u4e00\u4e2a\u5217\u8868\u9879 \u3002<\/p>\n<p>3\u3001\u8ff7\u4f60\u5217\u8868\u9879\u53ea\u7528\u4e8e\u6807\u8bb0\u5217\u8868\u7684\u672b\u5c3e\u548c\u6302\u8f7d\u5176\u4ed6\u63d2\u5165\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u6210\u5458\u53d8\u91cf pxOwner \u548c pxContainer\uff0c\u4ee5\u8282\u7701\u5185\u5b58\u5f00\u9500\u3002<\/p>\n<p>\u6211\u4eec\u6765\u7ec6\u7ec6\u54c1\u9274\u4e00\u4e0b\u4ec0\u4e48\u53eb\u505a\u201c<span style=\"color: #ff6600;\"><strong>\u6302\u8f7d\u5176\u4ed6\u63d2\u5165\u5217\u8868\u7684\u5217\u8868\u9879<\/strong><\/span>\u201d\uff1a<\/p>\n<p>\u6211\u4eec\u7684\u4e00\u4e2a\u5217\u8868\uff0c\u4ed6\u4e00\u5f00\u59cb\u521d\u59cb\u5316\u7684\u65f6\u5019\uff0c\u53ea\u6709\u4e09\u4e2a\u6210\u5458\u53d8\u91cf(\u90a3\u4e24\u4e2a\u5e38\u91cf\u4e0d\u7b97)\uff0c\u4e00\u4e2a\u662fuxNumberOfItems(\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\u6570\u76ee)\u3001\u4e00\u4e2a\u662f*pxIndex(\u7528\u4e8e\u904d\u5386\u5217\u8868\u9879\u7684\u6307\u9488)\u3001\u4e00\u4e2a\u662fxListEnd(\u672b\u5c3e\u5217\u8868\u9879\uff0c\u5373\u8ff7\u4f60\u5217\u8868\u9879)\uff0c\u90a3\u6211\u4eec\u60f3\u8981\u63d2\u5165\u4e00\u4e2a\u5217\u8868\u9879\uff0c\u8be5\u600e\u4e48\u63d2\u5165\uff1f\u90a3\u5c31\u662f\u901a\u8fc7\u8ff7\u4f60\u5217\u8868\u9879\u4e2d\u7684\u5217\u8868\u9879\u6307\u5411\u60f3\u8981\u63d2\u5165\u7684\u5217\u8868\u9879\uff0c\u60f3\u8981\u63d2\u5165\u7684\u5217\u8868\u7684\u4e0b\u4e00\u4e2a\u9879\u8981\u6307\u5411\u8ff7\u4f60\u5217\u8868\u9879\u4e2d\u7684\u5217\u8868\u9879\u3002<\/p>\n<p>\u518d\u770b\u4e00\u4e0b\u6211\u4eec\u4e00\u5f00\u59cb\u7684\u56fe\uff0c\u662f\u5426\u5c31\u6709\u66f4\u597d\u7684\u7406\u89e3\u7684\u5462\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1623\" src=\"https:\/\/aoofoo.com\/wp-content\/uploads\/2025\/03\/\u5c4f\u5e55\u622a\u56fe-2025-03-19-161336.png\" alt=\"\" width=\"837\" height=\"371\" \/><\/p>\n<h3>\u5217\u8868\u548c\u5217\u8868\u9879\u7684\u5173\u7cfb<\/h3>\n<p>1\u3001\u5217\u8868\u521a\u5f00\u59cb\u662f\u8fd9\u6837\u7684\uff1a<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1624\" src=\"https:\/\/aoofoo.com\/wp-content\/uploads\/2025\/03\/\u5c4f\u5e55\u622a\u56fe-2025-03-19-170524.png\" alt=\"\" width=\"140\" height=\"141\" \/><\/p>\n<p>\u5206\u522b\u662f\u5217\u8868\u9879\u5206\u522b\u662f \u5217\u8868\u9879\u7684\u6570\u76ee\u3001\u6307\u5411\u67d0\u4e00\u4e2a\u5217\u8868\u9879\u548c\u672b\u5c3e\u5217\u8868\u9879\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>2\u3001\u6211\u4eec\u521d\u59cb\u5316\u5217\u8868\u540e\uff0c\u4f1a\u53d8\u6210\u8fd9\u6837\uff1a<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1626\" src=\"https:\/\/aoofoo.com\/wp-content\/uploads\/2025\/03\/\u5c4f\u5e55\u622a\u56fe-2025-03-19-171350.png\" alt=\"\" width=\"147\" height=\"235\" \/><\/p>\n<p>\u5f53\u7136\uff0c\u521d\u59cb\u5316\u5217\u8868\u7684\u51fd\u6570\u6211\u4eec\u8fd8\u6ca1\u6709\u4ecb\u7ecd\uff0c\u6211\u4eec\u5148\u770b\u8fd9\u4e00\u4e2a\u793a\u610f\u56fe\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u5217\u8868\u9879\u7684\u6570\u76ee\u662f0\uff0c\u4ee3\u8868\u672b\u5c3e\u5217\u8868\u9879\u4e0d\u8ba1\u5165\u5217\u8868\u9879\u6570\u76ee\u4e2d\uff1b*pxIndex\u662f\u6307\u5411\u67d0\u4e2a\u5217\u8868\u9879\uff0c\u4f46\u73b0\u5728\u5217\u8868\u4e2d\u53ea\u6709\u672b\u5c3e\u5217\u8868\u9879\uff0c\u6240\u4ee5\u662f\u6307\u5411\u672b\u5c3e\u5217\u8868\u9879\u3002\u6211\u4eec\u518d\u770b\u672b\u5c3e\u5217\u8868\u9879\uff0c\u53ef\u4ee5\u770b\u5230\u5b83\u5173\u4e8e\u5217\u8868\u9879\u7684\u503c\u662f\u6700\u5927\u7684\uff0c\u8fd9\u53ef\u4ee5\u4fdd\u8bc1\u4ed6\u662f\u6302\u8f7d\u5230\u6700\u540e\uff0c\u4e00\u76f4\u5145\u5f53\u672b\u5c3e\u5217\u8868\u9879\u3002\u7136\u540e\u6211\u4eec\u4e5f\u53ef\u4ee5\u770b\u5230\uff0c\u672b\u5c3e\u5217\u8868\u9879\u4e2d\u7684\u4e0a\u4e00\u9879\u548c\u4e0b\u4e00\u9879\u90fd\u662f\u6307\u5411\u4ed6\u81ea\u5df1\u7684\uff0c\u56e0\u4e3a\u662f\u521a\u521d\u59cb\u5316\uff0c\u8fd8\u6ca1\u6709\u5176\u4ed6\u5217\u8868\u3002<\/p>\n<p>3\u3001\u8ba9\u6211\u4eec\u63d2\u5165\u4e24\u4e2a\u5217\u8868\u9879\uff0c\u5206\u522b\u662f\u5217\u8868\u98791\u3001\u5217\u8868\u98792\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1627\" src=\"https:\/\/aoofoo.com\/wp-content\/uploads\/2025\/03\/\u5c4f\u5e55\u622a\u56fe-2025-03-19-172822.png\" alt=\"\" width=\"1369\" height=\"633\" \/><\/p>\n<h2>\u5217\u8868\u76f8\u5173API\u51fd\u6570<\/h2>\n<table width=\"618\">\n<tbody>\n<tr>\n<td width=\"260\">\n<p style=\"text-align: center;\"><b>\u51fd\u6570<\/b><\/p>\n<\/td>\n<td style=\"text-align: center;\" width=\"358\"><b>\u63cf\u8ff0<\/b><\/td>\n<\/tr>\n<tr>\n<td width=\"260\">vListInitialise()<\/td>\n<td width=\"358\">\u521d\u59cb\u5316\u5217\u8868\uff0c\u5217\u8868\u7684\u521d\u59cb\u72b6\u6001\u901a\u8fc7\u5176\u5b9e\u73b0\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"260\">vListInitialiseItem()<\/td>\n<td width=\"358\">\u521d\u59cb\u5316\u5217\u8868\u9879\uff0c\u5176\u5b9e\u5c31\u662f\u5bf9\u5217\u8868\u548c\u5217\u8868\u9879\u5404\u81ea\u6210\u5458\u8d4b\u521d\u59cb\u503c\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"260\">vListInsertEnd()<\/td>\n<td width=\"358\">\u5217\u8868\u672b\u5c3e\u63d2\u5165\u5217\u8868\u9879\uff08\u6307\u5b9a\u63d2\u5165\u6cd5\uff09<\/td>\n<\/tr>\n<tr>\n<td width=\"260\">vListInsert()<\/td>\n<td width=\"358\">\u5217\u8868\u63d2\u5165\u5217\u8868\u9879\uff08\u5347\u5e8f\u63d2\u5165\u6cd5\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" width=\"260\">\n<p style=\"text-align: left;\">uxListRemove()<\/p>\n<\/td>\n<td width=\"358\">\n<p style=\"text-align: left;\">\u5217\u8868\u79fb\u9664\u5217\u8868\u9879<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u6211\u4eec\u6765\u770b\u521d\u59cb\u5316<span style=\"color: #ff6600;\"><strong>\u5217\u8868<\/strong><\/span>vListInitialise() \u51fd\u6570\u7684\u5185\u90e8\u5b9e\u73b0\uff1a<\/p>\n<table style=\"height: 125px;\" width=\"621\">\n<tbody>\n<tr>\n<td width=\"127\"><b>\u5f62\u53c2<\/b><\/td>\n<td width=\"127\"><b>\u63cf\u8ff0<\/b><\/td>\n<\/tr>\n<tr>\n<td width=\"127\">pxList<\/td>\n<td width=\"127\">\u5f85\u521d\u59cb\u5316\u5217\u8868<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"corepress-code-pre\"><code>void vListInitialise(List_t * const pxList)\r\n{\t\r\n\/\/\u521d\u59cb\u5316\u65f6\uff0c\u5217\u8868\u4e2d\u53ea\u6709 xListEnd\uff0c\u56e0\u6b64 pxIndex \u6307\u5411 xListEnd \u3002\r\n\tpxList-&gt;pxIndex = ( ListItem_t * ) &amp;( pxList-&gt;xListEnd );\r\n\/\/xListEnd \u7684\u503c\u521d\u59cb\u5316\u4e3a\u6700\u5927\u503c\uff0c\u7528\u4e8e\u5217\u8868\u9879\u5347\u5e8f\u6392\u5e8f\u65f6\uff0c\u6392\u5728\u6700\u540e\u3002\r\n\tpxList-&gt;xListEnd.xItemValue = portMAX_DELAY;\r\n\/\/\u521d\u59cb\u5316\u65f6\uff0c\u5217\u8868\u4e2d\u53ea\u6709 xListEnd\uff0c\u56e0\u6b64\u4e0a\u4e00\u4e2a\u548c\u4e0b\u4e00\u4e2a\u5217\u8868\u9879\u90fd\u4e3axListEnd \u672c\u8eab\u3002\r\n\tpxList-&gt;xListEnd.pxNext = ( ListItem_t * ) &amp;( pxList-&gt;xListEnd );\r\n        pxList-&gt;xListEnd.pxPrevious = ( ListItem_t * ) &amp;( pxList-&gt;xListEnd );\t\r\n\/\/\u521d\u59cb\u5316\u65f6\uff0c\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\u6570\u91cf\u4e3a 0\uff08\u4e0d\u5305\u542b xListEnd\uff09\r\n\tpxList-&gt;uxNumberOfItems = ( UBaseType_t ) 0U;\t\r\n\/\/\u521d\u59cb\u5316\u7528\u4e8e\u68c0\u6d4b\u5217\u8868\u6570\u636e\u5b8c\u6574\u6027\u7684\u6821\u9a8c\uff0c\u6211\u4eec\u6ca1\u7528\u8fd9\u4e24\u4e2a\u4ee3\u7801\uff0c\u4e0d\u7528\u7ba1\r\n\tlistSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );\t \r\n        listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );\r\n} \r\n\r\n<\/code><\/pre>\n<p>\u6211\u4eec\u6765\u770b\u521d\u59cb\u5316<span style=\"color: #ff6600;\"><strong>\u5217\u8868\u9879<\/strong><\/span>vListInitialiseItem()\u00a0 \u51fd\u6570\u7684\u5185\u90e8\u5b9e\u73b0\uff1a<\/p>\n<table style=\"height: 130px;\" width=\"701\">\n<tbody>\n<tr>\n<td width=\"200\"><b>\u5f62\u53c2<\/b><\/td>\n<td width=\"200\"><b>\u63cf\u8ff0<\/b><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">pxItem<\/td>\n<td width=\"200\">\u5f85\u521d\u59cb\u5316\u5217\u8868\u9879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"corepress-code-pre\"><code>void vListInitialiseItem( ListItem_t * const pxItem )\r\n{\t\t\r\n\/\/\u521d\u59cb\u5316\u65f6\uff0c\u5217\u8868\u9879\u6240\u5728\u5217\u8868\u8bbe\u4e3a\u7a7a\r\npxItem-&gt;pxContainer = NULL;\r\n\/\/\u521d\u59cb\u5316\u7528\u4e8e\u68c0\u6d4b\u5217\u8868\u9879\u6570\u636e\u5b8c\u6574\u6027\u7684\u6821\u9a8c\u503c\r\nlistSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );\t\r\nlistSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );\r\n} \r\n<\/code><\/pre>\n<p>\u5217\u8868\u9879\u76ee\u7684\u5347\u5e8f\u63d2\u5165vListInsert()\u51fd\u6570\u7684\u5185\u90e8\u5b9e\u73b0\uff1a<\/p>\n<table style=\"height: 80px;\" width=\"698\">\n<tbody>\n<tr>\n<td width=\"201\"><b>\u5f62\u53c2<\/b><\/td>\n<td width=\"220\"><b>\u63cf\u8ff0<\/b><\/td>\n<\/tr>\n<tr>\n<td width=\"201\">pxList<\/td>\n<td width=\"220\">\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td width=\"201\">pxNewListItem<\/td>\n<td width=\"220\">\u5f85\u63d2\u5165\u5217\u8868\u9879<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"corepress-code-pre\"><code>void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) \r\n{\r\n\/*\u521b\u5efa\u4e00\u4e2a\u6307\u9488\uff0c\u7528\u4e8e\u540e\u7eed\u64cd\u4f5c*\/\r\n \tListItem_t * pxIterator; \r\n\r\n\/* \u83b7\u53d6\u5217\u8868\u9879\u7684\u6570\u503c\u4f9d\u636e\u6570\u503c\u5347\u5e8f\u6392\u5217 *\/\r\n\tconst TickType_t  xValueOfInsertion  =  pxNewListItem-&gt;xItemValue;\r\n\r\n\/* \u68c0\u67e5\u53c2\u6570\u662f\u5426\u6b63\u786e\uff0c\u65e0\u9700\u5173\u5fc3\u8fd9\u4e24\u884c *\/ \t\r\n\tlistTEST_LIST_INTEGRITY( pxList ); \t\t\t\t\r\n\tlistTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); \t\r\n\r\n \/* \u5982\u679c\u5f85\u63d2\u5165\u5217\u8868\u9879\u7684\u503c\u4e3a\u6700\u5927\u503c *\/ \t\t\t\r\n\tif( xValueOfInsertion == portMAX_DELAY )\r\n \t{ \r\n                \/* \u63d2\u5165\u7684\u4f4d\u7f6e\u4e3a\u5217\u8868 xListEnd \u524d\u9762 *\/ \r\n\t\tpxIterator = pxList-&gt;xListEnd.pxPrevious; \t\t\t\t\r\n\t} else \r\n\t{\r\n                \/*\u904d\u5386\u5217\u8868\u4e2d\u7684\u5217\u8868\u9879\uff0c\u627e\u5230\u63d2\u5165\u7684\u4f4d\u7f6e*\/ \r\n\t\tfor(  pxIterator = ( ListItem_t * ) &amp;( pxList-&gt;xListEnd ); \r\n\t\t         pxIterator-&gt;pxNext-&gt;xItemValue &lt;= xValueOfInsertion; \r\n\t\t         pxIterator = pxIterator-&gt;pxNext  ) { }\r\n\t} \r\n\r\n\r\n\/* \u5c06\u5f85\u63d2\u5165\u7684\u5217\u8868\u9879\u63d2\u5165\u6307\u5b9a\u4f4d\u7f6e *\/ \r\n\tpxNewListItem-&gt;pxNext = pxIterator-&gt;pxNext;\t\t\t\t\t\r\n \tpxNewListItem-&gt;pxNext-&gt;pxPrevious = pxNewListItem; \r\n\tpxNewListItem-&gt;pxPrevious = pxIterator; \r\n\tpxIterator-&gt;pxNext = pxNewListItem; \r\n\r\n\/* \u66f4\u65b0\u5f85\u63d2\u5165\u5217\u8868\u9879\u6240\u5728\u5217\u8868 *\/ \t\r\n\tpxNewListItem-&gt;pxContainer = pxList; \t\r\n\t\r\n\/* \u66f4\u65b0\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u6570\u91cf *\/ \t\t\t\r\n\t( pxList-&gt;uxNumberOfItems )++;\t\t\t\t\t\t\r\n}\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u5217\u8868\u9879\u76ee\u7684\u65e0\u5e8f(\u6307\u5b9a)\u63d2\u5165vListInsert()\u51fd\u6570\u7684\u5185\u90e8\u5b9e\u73b0\uff1a<\/p>\n<table style=\"height: 145px;\" width=\"719\">\n<tbody>\n<tr>\n<td width=\"158\">\n<p style=\"text-align: center;\"><b>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5f62\u53c2<\/b><\/p>\n<\/td>\n<td style=\"text-align: center;\" width=\"150\"><b>\u63cf\u8ff0<\/b><\/td>\n<\/tr>\n<tr>\n<td width=\"158\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pxList<\/td>\n<td width=\"150\">\u5217\u8868<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\" width=\"158\">\n<p style=\"text-align: left;\">pxNewListItem<\/p>\n<\/td>\n<td width=\"150\">\n<p style=\"text-align: left;\">\u5f85\u63d2\u5165\u5217\u8868\u9879<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"corepress-code-pre\"><code>void vListInsertEnd (  List_t * const pxList ,   ListItem_t * const pxNewListItem  )\r\n{\r\n\t \u7701\u7565\u90e8\u5206\u975e\u5173\u952e\u4ee3\u7801 \u2026 \u2026\r\n\/* \u83b7\u53d6\u5217\u8868 pxIndex \u6307\u5411\u7684\u5217\u8868\u9879 *\/\t\r\nListItem_t * const pxIndex = pxList-&gt;pxIndex;\t\r\n\/* \u66f4\u65b0\u5f85\u63d2\u5165\u5217\u8868\u9879\u7684\u6307\u9488\u6210\u5458\u53d8\u91cf *\/\r\npxNewListItem-&gt;pxNext = pxIndex;\r\npxNewListItem-&gt;pxPrevious = pxIndex-&gt;pxPrevious;\r\n\r\n\/* \u66f4\u65b0\u5217\u8868\u4e2d\u539f\u672c\u5217\u8868\u9879\u7684\u6307\u9488\u6210\u5458\u53d8\u91cf *\/\r\npxIndex-&gt;pxPrevious-&gt;pxNext = pxNewListItem;\r\npxIndex-&gt;pxPrevious = pxNewListItem;\r\n\/* \u66f4\u65b0\u5f85\u63d2\u5165\u5217\u8868\u9879\u7684\u6240\u5728\u5217\u8868\u6210\u5458\u53d8\u91cf *\/\r\npxNewListItem-&gt;pxContainer = pxList;\r\n\/* \u66f4\u65b0\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u6570\u91cf *\/\r\n( pxList-&gt;uxNumberOfItems )++;\r\n} \r\n<\/code><\/pre>\n<p>\u6b64\u51fd\u6570\u7528\u4e8e\u5c06\u5f85\u63d2\u5165\u5217\u8868\u7684\u5217\u8868\u9879\u63d2\u5165\u5230\u5217\u8868 pxIndex \u6307\u9488\u6307\u5411\u7684\u5217\u8868\u9879\u524d\u9762\uff0c\u662f\u4e00\u79cd\u65e0\u5e8f\u7684\u63d2\u5165\u65b9\u6cd5 \u3002<\/p>\n<p>\u5217\u8868\u9879\u76ee\u7684\u79fb\u9664\u5217\u8868\u9879uxListRemove()\u51fd\u6570\u7684\u5185\u90e8\u5b9e\u73b0\uff1a<\/p>\n<table style=\"height: 115px;\" width=\"700\">\n<tbody>\n<tr>\n<td width=\"180\">\n<p style=\"text-align: center;\"><b>\u5f62\u53c2<\/b><\/p>\n<\/td>\n<td width=\"180\">\n<p style=\"text-align: center;\"><b>\u63cf\u8ff0<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"180\">pxItemToRemove<\/td>\n<td width=\"180\">\u5f85\u79fb\u9664\u7684\u5217\u8868\u9879\uff0c\u8fd9\u4e2a\u5217\u8868\u9879\u662f\u4e00\u4e2a\u7ed3\u6784\u4f53\uff0c\u6210\u5458\u91cc\u9762\u5b58\u50a8\u7740\u5b83\u6240\u5c5e\u5217\u8868<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"height: 126px;\" width=\"699\">\n<tbody>\n<tr>\n<td width=\"152\">\n<p style=\"text-align: center;\"><b>\u8fd4\u56de\u503c<\/b><\/p>\n<\/td>\n<td width=\"414\">\n<p style=\"text-align: center;\"><b>\u63cf\u8ff0<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"152\">\u6574\u6570<\/td>\n<td width=\"414\">\u5f85\u79fb\u9664\u5217\u8868\u9879\u79fb\u9664\u540e\uff0c\u6240\u5728\u5217\u8868\u5269\u4f59\u5217\u8868\u9879\u7684\u6570\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"corepress-code-pre\"><code>UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) \r\n{\r\n\tList_t * const pxList = pxItemToRemove-&gt;pxContainer; \r\n\/* \u4ece\u5217\u8868\u4e2d\u79fb\u9664\u5217\u8868\u9879 *\/ \r\n\tpxItemToRemove-&gt;pxNext-&gt;pxPrevious = pxItemToRemove-&gt;pxPrevious;\r\n\tpxItemToRemove-&gt;pxPrevious-&gt;pxNext = pxItemToRemove-&gt;pxNext; \t\r\n\r\n \/*\u5982\u679c pxIndex \u6b63\u6307\u5411\u5f85\u79fb\u9664\u7684\u5217\u8868\u9879 *\/ \r\n\tif( pxList-&gt;pxIndex == pxItemToRemove ) \r\n\t{\r\n                 \/*pxIndex \u6307\u5411\u4e0a\u4e00\u4e2a\u5217\u8868\u9879*\/ \r\n\t \tpxList-&gt;pxIndex = pxItemToRemove-&gt;pxPrevious;\r\n\t} else \r\n\t{ \r\n\t\tmtCOVERAGE_TEST_MARKER(); \r\n\t} \r\n\/*\u5c06\u5f85\u79fb\u9664\u7684\u5217\u8868\u9879\u7684\u6240\u5728\u5217\u8868\u6307\u9488\u6e05\u7a7a*\/ \r\n\tpxItemToRemove-&gt;pxContainer = NULL; \r\n\/*\u66f4\u65b0\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u6570\u91cf*\/ \r\n\t( pxList-&gt;uxNumberOfItems )--; \r\n\/*\u8fd4\u56de\u79fb\u9664\u540e\u7684\u5217\u8868\u4e2d\u5217\u8868\u9879\u7684\u6570\u91cf*\/ \r\n\treturn pxList-&gt;uxNumberOfItems; \r\n}\r\n<\/code><\/pre>\n<p>\u5176\u5b9e\u770b\u5b8c\u4e0a\u8ff0\u4ee3\u7801\uff0c\u5176\u5b9e\u4e0d\u96be\u53d1\u73b0\uff0c\u8fd9\u4e9b\u5173\u4e8e\u5217\u8868\u7684\u51fd\u6570\u5176\u5b9e\u5c31\u662f\u7b80\u5355\u7684\u53cc\u5411\u5faa\u73af\u94fe\u8868\u7684\u589e\u5220\u67e5\u6539\u3002<\/p>\n<h2>\u5217\u8868\u9879\u7684\u63d2\u5165\u548c\u5220\u9664\u5b9e\u73b0<\/h2>\n<p>1\u3001\u5b9e\u9a8c\u76ee\u7684\uff1a\u5b66\u4f1a\u5bf9FreeRTOS \u5217\u8868\u548c\u5217\u8868\u9879\u7684\u64cd\u4f5c\u51fd\u6570\u4f7f\u7528\uff0c\u5e76\u89c2\u5bdf\u8fd0\u884c\u7ed3\u679c\u548c\u7406\u8bba\u5206\u6790\u662f\u5426\u4e00\u81f4\u3002<\/p>\n<p>2\u3001\u5b9e\u9a8c\u8bbe\u8ba1\uff1a\u5c06\u8bbe\u8ba1\u4e09\u4e2a\u4efb\u52a1\uff1astart_task\u3001task1\u3001task2\u3002<\/p>\n<p>\u4e09\u4e2a\u4efb\u52a1\u7684\u529f\u80fd\u5982\u4e0b\uff1a<\/p>\n<p>start_task\uff1a\u7528\u6765\u521b\u5efa\u5176\u4ed6\u76842\u4e2a\u4efb\u52a1\u3002<\/p>\n<p>task1\uff1a\u5b9e\u73b0LED0\u6bcf500ms\u95ea\u70c1\u4e00\u6b21\uff0c\u7528\u6765\u63d0\u793a\u7cfb\u7edf\u6b63\u5728\u8fd0\u884c\u3002<\/p>\n<p>task2\uff1a\u8c03\u7528\u5217\u8868\u548c\u5217\u8868\u9879\u76f8\u5173API\u51fd\u6570\uff0c\u5e76\u4e14\u901a\u8fc7\u4e32\u53e3\u8f93\u51fa\u76f8\u5e94\u7684\u4fe1\u606f\uff0c\u8fdb\u884c\u89c2\u5bdf \u3002<\/p>\n<pre class=\"corepress-code-pre\"><code>List_t          TestList;           \/* \u5b9a\u4e49\u6d4b\u8bd5\u5217\u8868 *\/\r\nListItem_t      ListItem1;          \/* \u5b9a\u4e49\u6d4b\u8bd5\u5217\u8868\u98791 *\/\r\nListItem_t      ListItem2;          \/* \u5b9a\u4e49\u6d4b\u8bd5\u5217\u8868\u98792 *\/\r\nListItem_t      ListItem3;          \/* \u5b9a\u4e49\u6d4b\u8bd5\u5217\u8868\u98793 *\/\r\n\/\/\u4efb\u52a12\uff1a\u8c03\u7528\u5217\u8868\u548c\u5217\u8868\u9879\u76f8\u5173API\u51fd\u6570\uff0c\u5e76\u4e14\u901a\u8fc7\u4e32\u53e3\u8f93\u51fa\u76f8\u5e94\u7684\u4fe1\u606f,\u8fdb\u884c\u89c2\u5bdf \u3002\r\nvoid task2(void *pvParameters)\r\n{\r\n\t\r\n\t  vListInitialise(&amp;TestList);         \/* \u521d\u59cb\u5316\u5217\u8868 *\/\r\n    vListInitialiseItem(&amp;ListItem1);    \/* \u521d\u59cb\u5316\u5217\u8868\u98791 *\/\r\n    vListInitialiseItem(&amp;ListItem2);    \/* \u521d\u59cb\u5316\u5217\u8868\u98792 *\/\r\n    vListInitialiseItem(&amp;ListItem3);    \/* \u521d\u59cb\u5316\u5217\u8868\u98793 *\/\r\n    ListItem1.xItemValue = 40;\r\n    ListItem2.xItemValue = 60;\r\n    ListItem3.xItemValue = 50;\r\n\r\n    \/* \u7b2c\u4e8c\u6b65\uff1a\u6253\u5370\u5217\u8868\u548c\u5176\u4ed6\u5217\u8868\u9879\u7684\u5730\u5740 *\/\r\n    printf(\"\/**************\u7b2c\u4e8c\u6b65\uff1a\u6253\u5370\u5217\u8868\u548c\u5217\u8868\u9879\u7684\u5730\u5740**************\/\\r\\n\");\r\n    printf(\"\u9879\u76ee\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList\\t\\t0x%p\\t\\r\\n\", &amp;TestList);\r\n    printf(\"TestList-&gt;pxIndex\\t0x%p\\t\\r\\n\", TestList.pxIndex);\r\n    printf(\"TestList-&gt;xListEnd\\t0x%p\\t\\r\\n\", (&amp;TestList.xListEnd));\r\n    printf(\"ListItem1\\t\\t0x%p\\t\\r\\n\", &amp;ListItem1);\r\n    printf(\"ListItem2\\t\\t0x%p\\t\\r\\n\", &amp;ListItem2);\r\n    printf(\"ListItem3\\t\\t0x%p\\t\\r\\n\", &amp;ListItem3);\r\n    printf(\"\/**************************\u7ed3\u675f***************************\/\\r\\n\");\r\n    \r\n    printf(\"\\r\\n\/*****************\u7b2c\u4e09\u6b65\uff1a\u5217\u8868\u98791\u63d2\u5165\u5217\u8868******************\/\\r\\n\");\r\n    vListInsert((List_t*    )&amp;TestList,         \/* \u5217\u8868 *\/\r\n                (ListItem_t*)&amp;ListItem1);       \/* \u5217\u8868\u9879 *\/\r\n    printf(\"\u9879\u76ee\\t\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxNext\\t0x%p\\r\\n\", (TestList.xListEnd.pxNext));\r\n    printf(\"ListItem1-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem1.pxNext));\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxPrevious\\t0x%p\\r\\n\", (TestList.xListEnd.pxPrevious));\r\n    printf(\"ListItem1-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem1.pxPrevious));\r\n    printf(\"\/**************************\u7ed3\u675f***************************\/\\r\\n\");\r\n    \r\n    \/* \u7b2c\u56db\u6b65\uff1a\u5217\u8868\u98792\u63d2\u5165\u5217\u8868 *\/\r\n    printf(\"\\r\\n\/*****************\u7b2c\u56db\u6b65\uff1a\u5217\u8868\u98792\u63d2\u5165\u5217\u8868******************\/\\r\\n\");\r\n    vListInsert((List_t*    )&amp;TestList,         \/* \u5217\u8868 *\/\r\n                (ListItem_t*)&amp;ListItem2);       \/* \u5217\u8868\u9879 *\/\r\n    printf(\"\u9879\u76ee\\t\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxNext\\t0x%p\\r\\n\", (TestList.xListEnd.pxNext));\r\n    printf(\"ListItem1-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem1.pxNext));\r\n    printf(\"ListItem2-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem2.pxNext));\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxPrevious\\t0x%p\\r\\n\", (TestList.xListEnd.pxPrevious));\r\n    printf(\"ListItem1-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem1.pxPrevious));\r\n    printf(\"ListItem2-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem2.pxPrevious));\r\n    printf(\"\/**************************\u7ed3\u675f***************************\/\\r\\n\");\r\n    \r\n    \/* \u7b2c\u4e94\u6b65\uff1a\u5217\u8868\u98793\u63d2\u5165\u5217\u8868 *\/\r\n    printf(\"\\r\\n\/*****************\u7b2c\u4e94\u6b65\uff1a\u5217\u8868\u98793\u63d2\u5165\u5217\u8868******************\/\\r\\n\");\r\n    vListInsert((List_t*    )&amp;TestList,         \/* \u5217\u8868 *\/\r\n                (ListItem_t*)&amp;ListItem3);       \/* \u5217\u8868\u9879 *\/\r\n    printf(\"\u9879\u76ee\\t\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxNext\\t0x%p\\r\\n\", (TestList.xListEnd.pxNext));\r\n    printf(\"ListItem1-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem1.pxNext));\r\n    printf(\"ListItem2-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem2.pxNext));\r\n    printf(\"ListItem3-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem3.pxNext));\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxPrevious\\t0x%p\\r\\n\", (TestList.xListEnd.pxPrevious));\r\n    printf(\"ListItem1-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem1.pxPrevious));\r\n    printf(\"ListItem2-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem2.pxPrevious));\r\n    printf(\"ListItem3-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem3.pxPrevious));\r\n    printf(\"\/**************************\u7ed3\u675f***************************\/\\r\\n\");\r\n    \r\n    \/* \u7b2c\u516d\u6b65\uff1a\u79fb\u9664\u5217\u8868\u98792 *\/\r\n    printf(\"\\r\\n\/*******************\u7b2c\u516d\u6b65\uff1a\u79fb\u9664\u5217\u8868\u98792********************\/\\r\\n\");\r\n    uxListRemove((ListItem_t*   )&amp;ListItem2);   \/* \u79fb\u9664\u5217\u8868\u9879 *\/\r\n    printf(\"\u9879\u76ee\\t\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxNext\\t0x%p\\r\\n\", (TestList.xListEnd.pxNext));\r\n    printf(\"ListItem1-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem1.pxNext));\r\n    printf(\"ListItem3-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem3.pxNext));\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxPrevious\\t0x%p\\r\\n\", (TestList.xListEnd.pxPrevious));\r\n    printf(\"ListItem1-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem1.pxPrevious));\r\n    printf(\"ListItem3-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem3.pxPrevious));\r\n    printf(\"\/**************************\u7ed3\u675f***************************\/\\r\\n\");\r\n    \r\n    \/* \u7b2c\u4e03\u6b65\uff1a\u5217\u8868\u672b\u5c3e\u6dfb\u52a0\u5217\u8868\u98792 *\/\r\n    printf(\"\\r\\n\/****************\u7b2c\u4e03\u6b65\uff1a\u5217\u8868\u672b\u5c3e\u6dfb\u52a0\u5217\u8868\u98792****************\/\\r\\n\");\r\n    TestList.pxIndex = &amp;ListItem1;\r\n    vListInsertEnd((List_t*     )&amp;TestList,     \/* \u5217\u8868 *\/\r\n                   (ListItem_t* )&amp;ListItem2);   \/* \u5217\u8868\u9879 *\/\r\n    printf(\"\u9879\u76ee\\t\\t\\t\\t\u5730\u5740\\r\\n\");\r\n    printf(\"TestList-&gt;pxIndex\\t\\t0x%p\\r\\n\", TestList.pxIndex);\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxNext\\t0x%p\\r\\n\", (TestList.xListEnd.pxNext));\r\n    printf(\"ListItem1-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem1.pxNext));\r\n    printf(\"ListItem2-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem2.pxNext));\r\n    printf(\"ListItem3-&gt;pxNext\\t\\t0x%p\\r\\n\", (ListItem3.pxNext));\r\n    printf(\"TestList-&gt;xListEnd-&gt;pxPrevious\\t0x%p\\r\\n\", (TestList.xListEnd.pxPrevious));\r\n    printf(\"ListItem1-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem1.pxPrevious));\r\n    printf(\"ListItem2-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem2.pxPrevious));\r\n    printf(\"ListItem3-&gt;pxPrevious\\t\\t0x%p\\r\\n\", (ListItem3.pxPrevious));\r\n    printf(\"\/************************\u5b9e\u9a8c\u7ed3\u675f***************************\/\\r\\n\");\r\n\t\t\r\n\twhile(1)\r\n\t{\r\n\t\tprintf(\"\u4efb\u52a12\u8fd0\u884c\uff01\\r\\n\");\r\n\t\tvTaskDelay(1000);\r\n\t}\r\n\t\r\n}<\/code><\/pre>\n<p>\u901a\u8fc7\u89c2\u5bdf\u4e32\u53e3\u52a9\u624b\u7684\u6570\u636e\uff0c\u80fd\u591f\u548c\u6211\u4eec\u4e0a\u9762\u6240\u5b66\u7684\u7406\u8bba\u77e5\u8bc6\u4e00\u4e00\u5bf9\u5e94\uff0c\u6211\u4eec\u5bf9\u5217\u8868\u548c\u5217\u8868\u9879\u76f8\u6bd4\u4e5f\u662f\u638c\u63e1\u7684\u6bd4\u8f83\u597d\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5217\u8868\u548c\u5217\u8868\u9879\u7b80\u4ecb FreeRTOS\u4e2d\uff0c\u5217\u8868\u662f\u975e\u5e38\u91cd\u8981\u7684\uff01\u60f3\u8981\u770b\u61c2FreeRTOS\u7684\u6e90\u7801\uff0c\u5b66\u4f1a\u5217\u8868\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1619","post","type-post","status-publish","format-standard","hentry","category-rtos"],"_links":{"self":[{"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/posts\/1619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/comments?post=1619"}],"version-history":[{"count":9,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/posts\/1619\/revisions"}],"predecessor-version":[{"id":1633,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/posts\/1619\/revisions\/1633"}],"wp:attachment":[{"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/media?parent=1619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/categories?post=1619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aoofoo.com\/index.php\/wp-json\/wp\/v2\/tags?post=1619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}