当前位置: 首页 > news >正文

dw使用模板做网站教程网站源码如何安装

dw使用模板做网站教程,网站源码如何安装,网站建设论坛排名,检察网站建设1.列表与列表项概念及结构体介绍 1.1列表项简介 列表相当于链表,列表项相当于节点,FreeRTOS 中的列表是一个双向环形链表 1.2 列表、列表项、迷你列表项结构体 1)列表结构体 typedef struct xLIST { listFIRST_LIST_INTEGRITY_CHECK_VAL…

1.列表与列表项概念及结构体介绍

1.1列表项简介

列表相当于链表,列表项相当于节点,FreeRTOS 中的列表是一个双向环形链表
在这里插入图片描述

1.2 列表、列表项、迷你列表项结构体

1)列表结构体
typedef struct xLIST
{
listFIRST_LIST_INTEGRITY_CHECK_VALUE /* 校验值 /
volatile UBaseType_t uxNumberOfItems; /
列表中的列表项数量 /
ListItem_t * configLIST_VOLATILE pxIndex /
用于遍历列表项的指针 /
MiniListItem_t xListEnd /
末尾列表项 /
listSECOND_LIST_INTEGRITY_CHECK_VALUE /
校验值 /
} List_t;
列表结构体示意图
在这里插入图片描述
2)列表结构体
struct xLIST_ITEM
{
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /
用于检测列表项的数据完整性 /
configLIST_VOLATILE TickType_t xItemValue /
列表项的值 /
struct xLIST_ITEM * configLIST_VOLATILE pxNext /
下一个列表项 /
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious /
上一个列表项 /
void * pvOwner /
列表项的拥有者 (通常是任务控制块)/
struct xLIST * configLIST_VOLATILE pxContainer; /
列表项所在列表 /
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /
用于检测列表项的数据完整性 /
};
typedef struct xLIST_ITEM ListItem_t;
2)迷你结构体
迷你列表项也是列表项,但迷你列表项仅用于标记列表的末尾和挂载其他插入列表中的列表项
struct xMINI_LIST_ITEM
{
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /
用于检测数据完整性 /
configLIST_VOLATILE TickType_t xItemValue; /
列表项的值 /
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /
上一个列表项 /
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /
下一个列表项 */
};
typedef struct xMINI_LIST_ITEM MiniListItem_t;

2.列表相关API函数介绍

1)void vListInitialise(List_t * const pxList)
形参:pxList 待初始化列表项
描述:初始化列表,pxIndex 指向 xListEnd,xListEnd为oxFFFFFF
2)void vListInitialiseItem( ListItem_t * const pxItem )
形参: pxItem 带初始化列表项
描述: 初始化列表项,列表项所在列表为空,pxItem->pxContainer = NULL
3void vListInsertEnd ( List_t * const pxList , ListItem_t * const pxNewList)
形参:pxList 列表
pxNewListItem 待插入列表项 ,,无序的插入方法
描述:列表末尾插入列表项
4)void vListInsert ( List_t * const pxList , ListItem_t * const pxNewListItem )
形参:pxList 列表
pxNewListItem 待插入列表项
描述: 列表插入列表项,有序地插入到列表中
5)UBaseType_t uxListRemove ( ListItem_t * const pxItemToRemove )
形参:pxItemToRemove 待移除列表项
返回值:整数: 待移除列表项移除后,所在列表剩余列表项的数量
描述:列表移除列表项

3,列表项的插入和删除实验free_

3.1freertos_demo.h

#ifndef __FREERTOS_DEMO_H
#define __FREERTOS_DEMO_H//定义freeRTOS实验函数
void freertos_demo(void);#endif

3.1freertos_demo.c


#include "freertos_demo.h"
#include "./SYSTEM/usart/usart.h"
#include "./BSP/LCD/lcd.h"
#include "./BSP/KEY/key.h"
/*FreeRTOS*********************************************************************************************/
#include "FreeRTOS.h"
#include "task.h"///******************************************************************************************************/
//1.定义start_task配置与task任务配置以及声明列表项1.2.3
//1.1 start_task任务配置、包括栈大小、任务优先级、任务句柄以及start_task()函数定义
#define START_TASK_PRIO            1
#define START_STK_SIZE           128
TaskHandle_t  g_start_task_handler;
void start_task(void* pvParameters);//1.2 task1任务配置
#define TASK1_PRIO                 2
#define TASK1_SIZE               128
TaskHandle_t  g_task1_handler;
void task1(void* pvParameters);//1.3 列表与列表项1、2、3声明
List_t           test_list;
ListItem_t     list_item1;
ListItem_t     list_item2;
ListItem_t     list_item3;//2.创建freertos_demo()函数,在此函数中创建start_task任务,并开始任务调度
void freertos_demo(void)
{//2.1创建任务satrt_taskxTaskCreate( (TaskFunction_t)    start_task,                //函数地址(char *)           "start_task",              //函数名称(uint16_t)         START_STK_SIZE,            //栈大小(void *)           NULL,                      //传递给任务函数参数(UBaseType_t)      START_TASK_PRIO,           //任务优先级(TaskHandle_t *)   &g_start_task_handler );   //任务句柄//2.2 开启任务调度器vTaskStartScheduler();
}//3.创建start_task()函数中创建任务task1,并删除start_task任务
void start_task(void* pvParameters)
{//3.2 设置临界代码保护taskENTER_CRITICAL();//3.1创建任务task1xTaskCreate( (TaskFunction_t)    task1,               //函数地址(char *)            "task1",              //函数名称(uint16_t)         TASK1_SIZE,            //栈大小(void *)           NULL,                  //传递给任务函数参数(UBaseType_t)      TASK1_PRIO,            //任务优先级(TaskHandle_t *)   &g_task1_handler );    //任务句柄//3.3 删除任务start_taskvTaskDelete(g_start_task_handler);taskEXIT_CRITICAL();}//4.在task1()函数中进行列表项与列表项的初始化、地址打印、插入与删除
void task1(void* pvParameters)
{//4.1 初始化列表和列表项的地址vListInitialise(&test_list);vListInitialiseItem(&list_item1);vListInitialiseItem(&list_item2);vListInitialiseItem(&list_item3);//4.2打印列表和各列表项的地址printf("/**************第二步:打印列表和列表项的地址**************/\r\n");printf("项目\t\t\t地址\r\n");printf("test_list\t\t0x%p\t\r\n", &test_list);printf("test_list->pxIndex\t0x%p\t\r\n", test_list.pxIndex);printf("test_list->xListEnd\t0x%p\t\r\n", (&test_list.xListEnd));printf("list_item1\t\t0x%p\t\r\n", &list_item1);printf("list_item2\t\t0x%p\t\r\n", &list_item2);printf("list_item3\t\t0x%p\t\r\n", &list_item3);printf("/**************************结束***************************/\r\n");//4.3设置key0,插入列表项1,2,3,打印列表及列表项地址printf("按下KEY0键继续!\r\n\r\n\r\n");while(key_scan(0) != KEY0_PRES){vTaskDelay(10);}printf("/**************第三步:插入列表项1,2,3打印列表和列表项的地址**************/\r\n");vListInsert(&test_list,&list_item1);vListInsert(&test_list,&list_item2);vListInsert(&test_list,&list_item3);printf("项目\t\t\t\t地址\r\n");printf("test_list->xListEnd->pxNext\t0x%p\r\n", (test_list.xListEnd.pxNext));printf("test_list->xListEnd->pxPrevious\t0x%p\r\n", (test_list.xListEnd.pxPrevious));printf("list_item1->pxNext\t\t0x%p\r\n",     (list_item1.pxNext));printf("list_item1->pxPrevious\t\t0x%p\r\n", (list_item1.pxPrevious));printf("list_item2->pxNext\t\t0x%p\r\n",     (list_item2.pxNext));printf("list_item2->pxPrevious\t\t0x%p\r\n", (list_item2.pxPrevious));printf("list_item3->pxNext\t\t0x%p\r\n",     (list_item3.pxNext));printf("list_item3->pxPrevious\t\t0x%p\r\n", (list_item3.pxPrevious));printf("/**************************结束***************************/\r\n");//4.4设置key0,删除列表项2,打印列表及列表项地址printf("按下KEY0键继续!\r\n\r\n\r\n");while(key_scan(0) != KEY0_PRES){vTaskDelay(10);}printf("/*******************第六步:移除列表项2********************/\r\n");uxListRemove(&list_item2);printf("项目\t\t\t\t地址\r\n");printf("test_list->xListEnd->pxNext\t0x%p\r\n", (test_list.xListEnd.pxNext));printf("test_list->xListEnd->pxPrevious\t0x%p\r\n", (test_list.xListEnd.pxPrevious));printf("list_item1->pxNext\t\t0x%p\r\n", (list_item1.pxNext));printf("list_item1->pxNext\t\t0x%p\r\n", (list_item1.pxNext));printf("list_item3->pxPrevious\t\t0x%p\r\n", (list_item3.pxPrevious));printf("list_item3->pxPrevious\t\t0x%p\r\n", (list_item3.pxPrevious));printf("/**************************结束***************************/\r\n");//4.5设置key0,尾插法插入列表项3,打印列表及列表项地址printf("按下KEY0键继续!\r\n\r\n\r\n");while(key_scan(0) != KEY0_PRES){vTaskDelay(10);}printf("/*******************第六步:尾差法插入列表项2********************/\r\n");vListInsertEnd(&test_list,&list_item2);printf("项目\t\t\t\t地址\r\n");printf("test_list->xListEnd->pxNext\t0x%p\r\n", (test_list.xListEnd.pxNext));printf("test_list->xListEnd->pxPrevious\t0x%p\r\n", (test_list.xListEnd.pxPrevious));printf("list_item1->pxNext\t\t0x%p\r\n", (list_item1.pxNext));printf("list_item1->pxNext\t\t0x%p\r\n", (list_item1.pxNext));printf("list_item3->pxPrevious\t\t0x%p\r\n", (list_item3.pxPrevious));printf("list_item3->pxPrevious\t\t0x%p\r\n", (list_item3.pxPrevious));printf("list_item2->pxPrevious\t\t0x%p\r\n", (list_item2.pxPrevious));printf("list_item2->pxPrevious\t\t0x%p\r\n", (list_item2.pxPrevious));printf("/**************************结束***************************/\r\n");
}
http://www.yayakq.cn/news/289086/

相关文章:

  • 网站建设公司哪家好速找盛世传媒asp类似wordpress
  • 佛山网站制作专业公司小程序开发制作流程
  • 福建微网站建设wordpress 首页插件
  • php旅游网站cms个体工商户年报登录入口
  • 元做网站社区信息建设网站
  • 网站图片怎么做的高级wordpress头像管理插件
  • php网站制作工具网络市场前景分析
  • 济南做企业网站的公司jsp网站建设论文
  • 开网店软件整站排名优化品牌
  • 苏州建设信息网站网络顾问
  • 网站快速备案通道2016网站设计欣赏
  • 网站视频怎么下载到本地干净简约高端的网站
  • 商城网站开发的任务书wordpress关键词插件
  • wordpress网站不安全自己做网站需要备案么
  • 网站页面设计公司推荐长春网站优化策略
  • 给别人做网站的销售叫什么女的和女的做那个视频网站
  • 中国循环经济网站开发与设计成都 网站建设培训班
  • 我的网站突然打不开了福州直播app开发公司
  • 网站如何做cc防护哪里有放网站的免费空间
  • 做非法网站判刑多少年怎样自建网站
  • 网上商城系统平台官网深圳建站公司优化
  • dw怎么做phpcms网站专业的外贸网站
  • 自适应网站建设用wordpress做微博
  • 网站开发语言包括哪些某服装企业网站建设方案
  • 怎么查找一个网站开发时间南通公司网站模板建站
  • 什么网站做禽苗好的网站做鲜花的网站有哪些
  • 注册一个电商平台需要多少钱seo如何去做优化
  • 关于建设 医院网站的请示wordpress 采集站
  • 东源县住房和城乡建设部网站天猫网站建设的意义
  • 制作音乐网站实验报告国外ui界面设计网站