vSemaphoreCreateBinary(xActiveSemaphore);创建二值信号量后,不能立即使用xSemaphoreGive(xActiveSemaphore)释放二值信号量!官网说明如下:
vSemaphoreCreateBinary is a Macro to release a semaphore. The semaphore must have previously been created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or xSemaphoreCreateCounting(), and obtained using sSemaphoreTake().
意思是vSemaphoreCreateBinary 是一个用于释放信号量的宏。其中的信号量必须被xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or xSemaphoreCreateCounting()等函数调用完成后,而且必须被sSemaphoreTake()获取后才能使用!
简单地说是要xSemaphoreGive(xActiveSemaphore),必须创建了信号量后才可以!往往初始化中会出现如下问题