UCOSii中的信号量

2023-05-16

       任务间简单通个信,A告诉B你LED亮一下。这种问题可以用信号量来处理,UCOSii中关于信号量的函数也就八个,今天简单总结下。

  • 函数列表
/*
*********************************************************************************************************
*                                           CREATE A SEMAPHORE
*
* Description: This function creates a semaphore.
*
* Arguments  : cnt           is the initial value for the semaphore.  If the value is 0, no resource is
*                            available (or no event has occurred).  You initialize the semaphore to a
*                            non-zero value to specify how many resources are available (e.g. if you have
*                            10 resources, you would initialize the semaphore to 10).
*
* Returns    : != (void *)0  is a pointer to the event control block (OS_EVENT) associated with the
*                            created semaphore
*              == (void *)0  if no event control blocks were available
*********************************************************************************************************
*/
OS_EVENT  *OSSemCreate (INT16U cnt);


/*
*********************************************************************************************************
*                                         POST TO A SEMAPHORE
*
* Description: This function signals a semaphore
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            semaphore.
*
* Returns    : OS_ERR_NONE         The call was successful and the semaphore was signaled.
*              OS_ERR_SEM_OVF      If the semaphore count exceeded its limit.  In other words, you have
*                                  signalled the semaphore more often than you waited on it with either
*                                  OSSemAccept() or OSSemPend().
*              OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a semaphore
*              OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer.
*********************************************************************************************************
*/
INT8U  OSSemPost (OS_EVENT *pevent);


/*
*********************************************************************************************************
*                                           PEND ON SEMAPHORE
*
* Description: This function waits for a semaphore.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            semaphore.
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for the resource up to the amount of time specified by this argument.
*                            If you specify 0, however, your task will wait forever at the specified
*                            semaphore or, until the resource becomes available (or the event occurs).
*
*              perr          is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_ERR_NONE         The call was successful and your task owns the resource
*                                                or, the event you are waiting for occurred.
*                            OS_ERR_TIMEOUT      The semaphore was not received within the specified
*                                                'timeout'.
*                            OS_ERR_PEND_ABORT   The wait on the semaphore was aborted.
*                            OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a semaphore.
*                            OS_ERR_PEND_ISR     If you called this function from an ISR and the result
*                                                would lead to a suspension.
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer.
*                            OS_ERR_PEND_LOCKED  If you called this function when the scheduler is locked
*
* Returns    : none
*********************************************************************************************************
*/
void  OSSemPend (OS_EVENT  *pevent,
                 INT32U     timeout,
                 INT8U     *perr);


/*
*********************************************************************************************************
*                                      ABORT WAITING ON A SEMAPHORE
*
* Description: This function aborts & readies any tasks currently waiting on a semaphore.  This function
*              should be used to fault-abort the wait on the semaphore, rather than to normally signal
*              the semaphore via OSSemPost().
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            semaphore.
*
*              opt           determines the type of ABORT performed:
*                            OS_PEND_OPT_NONE         ABORT wait for a single task (HPT) waiting on the
*                                                     semaphore
*                            OS_PEND_OPT_BROADCAST    ABORT wait for ALL tasks that are  waiting on the
*                                                     semaphore
*
*              perr          is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_ERR_NONE         No tasks were     waiting on the semaphore.
*                            OS_ERR_PEND_ABORT   At least one task waiting on the semaphore was readied
*                                                and informed of the aborted wait; check return value
*                                                for the number of tasks whose wait on the semaphore
*                                                was aborted.
*                            OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a semaphore.
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer.
*
* Returns    : == 0          if no tasks were waiting on the semaphore, or upon error.
*              >  0          if one or more tasks waiting on the semaphore are now readied and informed.
*********************************************************************************************************
*/
INT8U  OSSemPendAbort (OS_EVENT  *pevent,
                       INT8U      opt,
                       INT8U     *perr);

/*
*********************************************************************************************************
*                                           ACCEPT SEMAPHORE
*
* Description: This function checks the semaphore to see if a resource is available or, if an event
*              occurred.  Unlike OSSemPend(), OSSemAccept() does not suspend the calling task if the
*              resource is not available or the event did not occur.
*
* Arguments  : pevent     is a pointer to the event control block
*
* Returns    : >  0       if the resource is available or the event did not occur the semaphore is
*                         decremented to obtain the resource.
*              == 0       if the resource is not available or the event did not occur or,
*                         if 'pevent' is a NULL pointer or,
*                         if you didn't pass a pointer to a semaphore
*********************************************************************************************************
*/
INT16U  OSSemAccept (OS_EVENT *pevent);


/*
*********************************************************************************************************
*                                         DELETE A SEMAPHORE
*
* Description: This function deletes a semaphore and readies all tasks pending on the semaphore.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            semaphore.
*
*              opt           determines delete options as follows:
*                            opt == OS_DEL_NO_PEND   Delete semaphore ONLY if no task pending
*                            opt == OS_DEL_ALWAYS    Deletes the semaphore even if tasks are waiting.
*                                                    In this case, all the tasks pending will be readied.
*
*              perr          is a pointer to an error code that can contain one of the following values:
*                            OS_ERR_NONE             The call was successful and the semaphore was deleted
*                            OS_ERR_DEL_ISR          If you attempted to delete the semaphore from an ISR
*                            OS_ERR_INVALID_OPT      An invalid option was specified
*                            OS_ERR_TASK_WAITING     One or more tasks were waiting on the semaphore
*                            OS_ERR_EVENT_TYPE       If you didn't pass a pointer to a semaphore
*                            OS_ERR_PEVENT_NULL      If 'pevent' is a NULL pointer.
*
* Returns    : pevent        upon error
*              (OS_EVENT *)0 if the semaphore was successfully deleted.
*
* Note(s)    : 1) This function must be used with care.  Tasks that would normally expect the presence of
*                 the semaphore MUST check the return code of OSSemPend().
*              2) OSSemAccept() callers will not know that the intended semaphore has been deleted unless
*                 they check 'pevent' to see that it's a NULL pointer.
*              3) This call can potentially disable interrupts for a long time.  The interrupt disable
*                 time is directly proportional to the number of tasks waiting on the semaphore.
*              4) Because ALL tasks pending on the semaphore will be readied, you MUST be careful in
*                 applications where the semaphore is used for mutual exclusion because the resource(s)
*                 will no longer be guarded by the semaphore.
*********************************************************************************************************
*/
OS_EVENT  *OSSemDel (OS_EVENT  *pevent,
                     INT8U      opt,
                     INT8U     *perr);


/*
*********************************************************************************************************
*                                          QUERY A SEMAPHORE
*
* Description: This function obtains information about a semaphore
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            semaphore
*
*              p_sem_data    is a pointer to a structure that will contain information about the
*                            semaphore.
*
* Returns    : OS_ERR_NONE         The call was successful and the message was sent
*              OS_ERR_EVENT_TYPE   If you are attempting to obtain data from a non semaphore.
*              OS_ERR_PEVENT_NULL  If 'pevent'     is a NULL pointer.
*              OS_ERR_PDATA_NULL   If 'p_sem_data' is a NULL pointer
*********************************************************************************************************
*/
INT8U  OSSemQuery (OS_EVENT     *pevent,
                   OS_SEM_DATA  *p_sem_data);

/*
*********************************************************************************************************
*                                              SET SEMAPHORE
*
* Description: This function sets the semaphore count to the value specified as an argument.  Typically,
*              this value would be 0.
*
*              You would typically use this function when a semaphore is used as a signaling mechanism
*              and, you want to reset the count value.
*
* Arguments  : pevent     is a pointer to the event control block
*
*              cnt        is the new value for the semaphore count.  You would pass 0 to reset the
*                         semaphore count.
*
*              perr       is a pointer to an error code returned by the function as follows:
*
*                            OS_ERR_NONE          The call was successful and the semaphore value was set.
*                            OS_ERR_EVENT_TYPE    If you didn't pass a pointer to a semaphore.
*                            OS_ERR_PEVENT_NULL   If 'pevent' is a NULL pointer.
*                            OS_ERR_TASK_WAITING  If tasks are waiting on the semaphore.
*********************************************************************************************************
*/
void  OSSemSet (OS_EVENT  *pevent,
                INT16U     cnt,
                INT8U     *perr);





使用 

1.创建信号量

2.发送信号量

3.等待信号量

这三个几乎应付了绝大部分场景了

OS_EVENT  *OSSemCreate (INT16U cnt);

INT8U  OSSemPost (OS_EVENT *pevent);

void  OSSemPend (OS_EVENT  *pevent,
                 INT32U     timeout,
                 INT8U     *perr);

//结构体指针声明
OS_EVENT *sem;

//信号量初始,10以下自己随意定义
INT8U cnt = 0;

int main()
{
	/*
	LED_Init();
	OSInit();
	OSTaskCreate(start_task,(void *)0, (OS_STK *)&START_TASK_STK[START_STK_SIZE-1],\
		START_TASK_PRID);
	OSStart();
	*/
}

void start_task(void* pdata)
{
	/*
	OS_CPU_SR cpu_sr = 0;
	pdata = pdata;
	OSStatInit();
	OS_ENTER_CRITICAL();
	OSTaskCreate(led0_task,(void*)0, (OS_STK*)&LED0_TASK_STK[LED0_STK_SIZE-1],\
				 LED0_TASK_PRIO);
	OSTaskCreate(led1_task,(void*)0, (OS_STK*)&LED1_TASK_STK[LED1_STK_SIZE-1],\
				 LED1_TASK_PRIO);
	OSTaskSuspend(START_TASK_PRID);
	*/
	sem = OSSemCreate(cnt); //初始化信号量指针
	/*
	OS_EXIT_CRITICAL();
	*/
}

void led0_task(void* pdata)
{
	/*
	uint8_t num = 0;
	while(1)
	{
		num++;
		LED0 = 0;
		delay_ms(80);
		LED0 = 1;
		if((num % 10 == 0))
		{
			*/
			OSSemPost(sem); //发送信号量
			/*
			printf("发送信号%d 次\r\n", num/10);
		}
		delay_ms(400);
	}
	*/
}

void led1_task(void* pdata)
{
	INT8U err = 0;
	/*
	while(1)
	{
		*/
		OSSemPend(sem, 0, &err); //一直等待信号到来,等待超时0
		/*
		LED1 = 0;
		delay_ms(300);		
		LED1 = 1;
		delay_ms(300);
	}
	*/
}

4.接收信号量

INT16U  OSSemAccept (OS_EVENT *pevent);

 基本代码不变,这里只改动task1的代码

void led1_task(void* pdata)
{
	INT8U ac;
	/*
	while(1)
	{
	*/
		ac = OSSemAccept(sem);
		if(ac == 1){ //接受成功返回1
			/*
			printf("我已经接收到信号了\r\n");
			LED1 = 0;
			delay_ms(300);
			LED1 = 1;
			delay_ms(300);
			*/
		}

		else//接收不成功返回0
		{
			/*
			printf("我还没成功的接收到信号了呢\r\n");
			delay_ms(500);
			*/
		}
/*
	}
	*/
}

 

5.删除信号量

OS_EVENT  *OSSemDel (OS_EVENT  *pevent,
                     INT8U      opt,
                     INT8U     *perr);

 

void led0_task(void* pdata)
{
	uint8_t num = 0, err = 0;
	/*
	while(1)
	{
		num++;
		LED0 = 0;
		delay_ms(80);
		LED0 = 1;
		if(num == 10)
		{
			*/
			//删除后sem为null
			sem = OSSemDel(sem, OS_DEL_ALWAYS,&err);
			/*
			printf("我已经删除了信号sem\r\n");
		}
		delay_ms(400);
	}
	*/
}

void led1_task(void* pdata)
{
	INT8U err = 0;
	/*
	while(1)
	{
		*/
		if(sem != NULL){ //判断信号量指针是否为空,是的话代表已经被删除了
			/*
		OSSemPend(sem, 0, &err);
		LED1 = 0;
		delay_ms(300);
		LED1 = 1;
		delay_ms(300);
		*/
		}

		else{
			/*
			printf("任务被删除了\r\n");
			*/
		}
	/*}*/
}

6.忽略优先级的等待信号量

INT8U  OSSemPendAbort (OS_EVENT  *pevent,
                       INT8U      opt,
                       INT8U     *perr);
void led1_task(void* pdata)
{
	INT8U err = 0;
	/*
	while(1)
	{
		*/
		OSSemPendAbort(sem, OS_PEND_OPT_NONE, &err); //忽视优先级的等待函数
		/*
		LED1 = 0;
		delay_ms(300);		
		LED1 = 1;
		delay_ms(300);
	}
	*/
}

7.信号量信息查询

INT8U  OSSemQuery (OS_EVENT     *pevent,
                   OS_SEM_DATA  *p_sem_data);
OS_SEM_DATA mdata;
void led1_task(void* pdata)
{
	INT8U err = 0;
	INT8U ac;
	while(1)
	{
		OSSemPend(sem, 0, &err); //等待有效信号到来才执行后面的
		LED1 = 0;
		delay_ms(300);
		LED1 = 1;
		delay_ms(300);
		ac = OSSemQuery(sem, &mdata);//mdata不能用指针初始化,没有地方给他分配内存
		if(ac == OS_ERR_NONE)
		{
			/*
			printf("成功\r\n");
			printf("hi 看看我是多少 %d %d\r\n", ac,mdata.OSCnt);
			*/
		}
	}
}

8.信号量设置

void  OSSemSet (OS_EVENT  *pevent,
                INT16U     cnt,
                INT8U     *perr);
void led1_task(void* pdata)
{
	INT8U err = 0;
	INT8U ac;
	while(1)
	{
		OSSemPend(sem, 0, &err); //等待有效信号到来才执行后面的
		LED1 = 0;
		delay_ms(300);
		LED1 = 1;
		delay_ms(300);
		OSSemSet (sem, 5, &err); //重新设置信号量为5
	}
}

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

UCOSii中的信号量 的相关文章

  • UCOSII中的任务切换原理介绍

    1 多任务的引入 之所以引入多任务 xff0c 主要在于提高程序运行的效率 多任务的过程 xff0c 能够有效地发挥交换式任务的运作效率 类似的 xff0c 由于一个任务里面也有瓶颈的地方 xff0c 为了把瓶颈的地方抠出来 xff0c 让
  • UCOSII学习---五、任务通信之信号量

    一 xff1a 信号量的理解 xff1a 信号量的本质是数据操作锁 xff0c 它本身不具有数据交换的功能 xff0c 而是通过控制其他的通信资源 xff08 文件 xff0c 外部设备 xff09 来实现进程间通信 xff0c 它本身只是
  • stm32 ucosii消息队列 串口_UC/OSII消息队列、信号量集和软件定时器

    UCOSII消息队列 信号量集和软件定时器简介 上一章 xff0c 我们介绍了信号量和邮箱的使用 xff0c 本章我们介绍比较复杂消息队列 信号量集以及软件定时器的使用 消息队列 使用消息队列可以在任务之间传递多条消息 消息队列由三个部分组
  • ucosii使用

    当需要同时跑多个任务的时候裸机显然不能很好的完成使命 xff0c 这个时候我们可以给单片机上系统 xff0c 创建多任务 xff0c 完成复杂逻辑 一 首先移植uocii在我们的板上 xff0c 根据mcu型号移植ucosii xff0c
  • STM32上使用UCOSII--消息队列和信号量集

    有关UCOS任务的介绍 xff1a STM32上使用UCOSII 任务 有关UCOS信号量和邮箱的介绍 xff1a STM32上使用UCOSII 信号量和邮箱 一 消息队列 使用消息队列可以在任务之间传递多条消息 消息队列由三个部分组成 x
  • ucosii消息队列学习

    近期在学习ucosii的内容使用的平台为STM32F103C8T6最小系统板 今日关于消息队列的使用遇到了一些问题 基本情况 xff1a 移植代码为正点原子ucosiii消息队列 信号量集和软件定时器例程 主要新建两个任务post task
  • UCOSII 消息队列、信号量集、软件定时器

    1 消息队列 xff1a 作用 xff1a 在任务之间传递多条信息 组成 xff1a 事件控制块 消息队列 消息 消息队列数据结构 队列控制块的结构定义 xff1a typedef struct os q struct os q OSQPt
  • ucosii消息队列使用

    ucosii消息队列简介 ucosii的消息队列源码定义在os q c文件 xff1b 接口全部声明在ucos ii h xff0c 总共有如下接口 xff1a span class token keyword void span span
  • rtthrea-ucosii-freertos三系统学习总结

    三系统基本功能对比 RT thread ucosii freertos 任务调度 抢占式 时间片式 xff08 多级队列位图调度 xff09 抢占式 xff08 纯位图调度 xff09 抢占式 时间片式 xff08 遍历列表调度 xff09
  • UCOSii中的信号量

    任务间简单通个信 xff0c A告诉B你LED亮一下 这种问题可以用信号量来处理 xff0c UCOSii中关于信号量的函数也就八个 xff0c 今天简单总结下 函数列表 CREATE A SEMAPHORE Description Thi
  • UCOSII 使用笔记

    UCOS使用总结 1 UCOS 是抢占式系统 xff0c 换句话来说 xff0c 优先级高的能够被准时执行 xff0c 优先级低的很容易被高优先级抢占 xff0c 导致执行任务延迟 2 UCOS一般为64个优先级 xff0c 有些可以到25
  • 从零开始学习UCOSII操作系统4--任务管理

    从零开始学习UCOSII操作系统4 任务管理 1 重讲任务 1 任务可以是一个无限的循环 xff0c 也可以在一次执行完毕后被删除 这里需要注意的是 xff0c 任务的代码并不是真正的删除了 xff0c 而是UCOSII不再理会该任务代码
  • 从零开始学习UCOSII操作系统7--信号量

    从零开始学习UCOSII操作系统7 信号量 参考博客 xff1a 64 http blog csdn net gatiemehttps blog csdn net gatieme article details 21071379 前言 xf
  • Java中的信号量(Semaphore)

    初识Semaphore 信号量 xff0c 也可以称其为 信号灯 xff0c 它的存在就如同生活中的红绿灯一般 xff0c 用来控制车辆的通行 在程序员眼中 xff0c 线程就好比行驶的车辆 xff0c 程序员就可以通过信号量去指定线程是否
  • ucosII 信号量使用总结(举例讲解)

    概述 信号量用于 xff1a 1 控制共享资源的使用权 xff08 满足互斥条件 xff09 2 标志某时间的发生 3 使2个任务的行为同步 OSSemCreate 赋初值 OSSemCreate INT16U cnt xff0c cnt为
  • ucosII的书籍

  • UCOSII 信号量和信号量集实例

    代码来自于书本光盘 嵌入式操作系统UCOSII原理及应用 实例1信号量 include 34 includes h 34 define TASK STK SIZE 512 任务堆栈长度 OS STK StartTaskStk TASK ST
  • UCOSII里面为什么调用OS_ENTER_CRITICAL()或OS_EXIT_CRITICAL()会出错,出错信息为:undeclared identifier `cpu_sr‘

    可以观察到OSTickISR Init 函数内部调用了OS ENTER CRITICAL 和OS EXIT CRITICAL 并且 1 该OSTickISR Init 函数所在的 C文件包含了includes h文件 include inc
  • os_mutex.c(全)

    无等待地获取互斥型信号量 OSMutexAccept OS EVENT pevent INT8U perr 创建互斥型信号量OS EVENT OSMutexCreate INT8U prio INT8U perr 删除信号量OS EVENT
  • uCOSii中的互斥信号量

    uCOSii中的互斥信号量 一 互斥型信号量项管理 MUTUAL EXCLUSION SEMAPHORE MANAGEMENT OSMutexAccept 无条件等待地获取互斥型信号量 OSMutexCreate 建立并初始化一个互斥型信号

随机推荐

  • 用遗传算法求解旅行商问题

    以下是用遗传算法解决旅行商问题的实验报告 1 问题描述 旅行商问题 xff08 Travelling Salesman Problem 简记TSP xff0c 亦称货郎担问题 xff1a 设有n个城市和距离矩阵D 61 dij xff0c
  • 学习LLC谐振变换电路的工作原理

    五 学习LLC谐振变换电路的工作原理 在具有电阻R 电感L和电容C元件的交流电路中 xff0c 电路两端的电压与其中电流相位一般是不同的 如果调节电路元件 xff08 L或C xff09 的参数或电源频率 xff0c 可以使它们相位相同 x
  • 关于电赛应该了解的事

    2021年1月31日 xff0c 全国大学生电子设计竞赛组委会向各赛区组委会 各有关高校下发 关于组织2021年全国大学生电子设计竞赛的通知 xff0c 正式启动2021年全国竞赛组织工作 电赛越来越近 xff0c 很多大一大二的同学还没有
  • stm32的基本学习路径---新手指南

    心得 xff1a 本人学习STM32的时候有一些跟风的因素 xff0c 自以为学的芯片越多就越厉害 61 61 其实 xff0c 学习嵌入式重要的是整体的工程思想和项目经验积累 xff0c 说到底这些芯片 xff0c 我感觉学习起来都差不多
  • 初学stm32建议的---实用开发板推荐

    STM32编程作为一项实操性很强的技能 xff0c 所以要多实操 初学的话 xff0c 我觉得书籍就暂时先不买吧 xff0c 先考虑入手一块STM32开发板 xff0c 然后跟着开发板的教程走 几年前 xff0c 做STM32的教程有很多家
  • 嵌入式操作系统-ucos是什么?

    一句话概括ucos系统 xff1a 一款源代码开放的 xff0c 抢占式多任务实时操作系统 其在整个嵌入式产品的架构中的角色和主要功能代码如下图所示 xff1a ucos 系统建立了用户程序和底层硬件之间沟通的渠道 通过ucos系统的管理和
  • 自学stm32,需要会到什么程度能找到一份工作?

    我是从大一就开始接触单片机 xff0c 学过很多类型的单片机 从最简单的51单片机 xff08 stc xff0c atmel intel等类型都用过 xff09 到国内现在最火的stm32 xff08 推荐正点原子 xff0c 后期很多项
  • 学习STM32的寄存器版本好还是库函数版本好

    我个人认为 xff0c 在回答这个问题之前 xff0c 你得先问清楚自己 xff0c 我学习stm32 或者再往更深的地方走 xff0c 我学习单片机 xff0c 究竟是为了什么 xff1f 你现在是处于什么状态 xff1f 你是学生还是已
  • proteus 8 打开proteus 7版本仿真文件的两个方法

    Proteus版本一直在更新 xff0c 其中常见的大版本Proteus 7 和Proteus 8兼容是有问题的 xff0c Proteus是向上兼容的 xff0c 高版本可以打开低版本的仿真 xff0c 低版本打不开高版本的 Proteu
  • stm32 单片机主要优点有哪些?

    51单片机之所以成为经典 xff0c 成为易上手的单片机主要有以下特点 xff1a 特性 xff1a 1 从内部的硬件到软件有一套完整的按位操作系统 xff0c 称作位处理器 xff0c 处理对象不是字或字节而是位 不但能对片内某些特殊功能
  • openmv入门之路

    如果你发现OpenCV函数繁多 xff01 xff01 xff01 如果你发现OpenCV配置繁琐 xff01 xff01 xff01 如果你发现自己买不起miniPC xff01 xff01 xff01 请选择OpenMV来完成你的项目吧
  • GMM(高斯混合模型)的动态背景分割

    以下是GMM xff08 高斯混合模型 xff09 的动态背景分割的实验报告以及源码 xff0c 另外用到了形态学操作与多通道的处理 xff0c 提升了实验结果的性能 一 实验名称 基于混合高斯模型的动态背景分割 二 实验目的 探索如何对W
  • OpenMv学习总结

    入门阶段 简单来说 xff0c OpenMv就是一个可编程的摄像头 xff0c 通过使用python语言 xff0c 专门用作嵌入式当中的视觉感光元件 下面将介绍Openmv使用过程中的常用知识 感光元件 感光元件即sensor模块 xff
  • 分享一下使用机智云APP控制战舰V3

    第一步 xff1a 注册机智云 xff0c 然后进入到开发者中心 xff0c 然后开始创建新产品 具体代码 xff0c 已经上传共享 设置好后点击保存 xff0c 这个时候会跳转到开发向导界面 xff0c 选择去添加数据点 我们建3个数据节
  • FreeRTOS进入函数prvStartFirstTask() 启动SVC后进入HardFault死循环

    FreeRTOS进入函数prvStartFirstTask 启动SVC后进入HardFault死循环 原因 xff1a 在初始化串口时为串口中断配置的NVIC与FreeRTOS的优先级设置冲突 解决方法 xff1a 设置USART的中断分组
  • docker修改默认存储路径

    docker修改默认存储路径 一 环境 xff1a centos7 x系统 xff0c 已经装好docker ce服务包 二 查看当前docker的存储路径 yukw 64 yfb docker info grep Dir WARNING
  • FreeRTOS变量和函数命名规则

    1 变量名 在 FreeRTOS 中 xff0c 定义变量的时候往往会把变量的类型当作前缀加在变量上 xff0c 这样的 好处是让用户一看到这个变量就知道该变量的类型 c char 型变量 s short 型变量 l long型变量 x p
  • Cannot Load Flash Programming Algorithm !错误解决方案,亲自验证过的几套方案

    当你下载程序的时候遇到Cannot Load Flash Programming Algorithm xff01 错误的时候是不是很崩溃 xff1f 按字面翻译的意思大概是编程算法不对 xff1b 一 这个问题我们一般先检查设备是否连接和编
  • 使用snprintf函数使用时注意事项

    snprintf函数 函数原型 xff1a int snprintf char str size t size const char format 简介 xff1a 将可变参数 按照format的格式格式化为字符串 xff0c 然后再将其拷
  • UCOSii中的信号量

    任务间简单通个信 xff0c A告诉B你LED亮一下 这种问题可以用信号量来处理 xff0c UCOSii中关于信号量的函数也就八个 xff0c 今天简单总结下 函数列表 CREATE A SEMAPHORE Description Thi