Skip to content

Commit

Permalink
Adding task to be registered by scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
nwdepatie committed Sep 27, 2023
1 parent 3a7250d commit 75a878b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Core/Inc/monitor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef MONITOR_H
#define MONITOR_H

#include "cmsis_os.h"

/* Defining Temperature Monitor Task */
void vTempMonitor(void *pv_params);

osThreadId_t temp_monitor_handle;
const osThreadAttr_t temp_monitor_attributes = {
.name = "TempMonitor",
.stack_size = 128 * 4,
.priority = (osPriority_t) osPriorityBelowNormal3,
};

#endif // MONITOR_H
3 changes: 2 additions & 1 deletion Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "main.h"
#include "cmsis_os.h"
#include "sht30.h"
#include "monitor.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
Expand Down Expand Up @@ -141,7 +142,7 @@ int main(void)
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);

/* USER CODE BEGIN RTOS_THREADS */
/* add threads, ... */
temp_monitor_handle = osThreadNew(vTempMonitor, NULL, &temp_monitor_attributes);
/* USER CODE END RTOS_THREADS */

/* USER CODE BEGIN RTOS_EVENTS */
Expand Down

0 comments on commit 75a878b

Please sign in to comment.