Skip to content
Snippets Groups Projects
Commit 83866da2 authored by pichlerbi76568's avatar pichlerbi76568
Browse files

change levels2

parent bf649b75
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@
/* USER CODE BEGIN Includes */
#include "ws2812b.h"
#include "queue.h"
#include "semphr.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
......@@ -109,6 +110,7 @@ static void MX_TIM2_Init(void);
void Levels(void *argument);
void Task02(void *argument);
void Task03(void *argument);
SemaphoreHandle_t xSemLevels;
/* USER CODE BEGIN PFP */
extern TIM_HandleTypeDef htim7;
......@@ -164,6 +166,8 @@ int main(void)
/* Create the semaphores(s) */
/* creation of mySem */
xSemLevels = xSemaphoreCreateBinary();
mySemHandle = osSemaphoreNew(1, 1, &mySem_attributes);
/* USER CODE BEGIN RTOS_SEMAPHORES */
......@@ -545,6 +549,8 @@ int counter=0;
int number;
/* Infinite loop */
for(;;)
{
if( xSemaphoreTake( xSemLevels, ( TickType_t ) 1000 ) == pdTRUE )
{
number=0;
if (counter <= 7)
......@@ -606,6 +612,7 @@ int number;
xQueueSend( toLEDMatrixHandle, &sendQueue, ( TickType_t ) 0 );
}
}
}
/* USER CODE BEGIN Header_Task02 */
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment