/** ****************************************************************************** * @file GPIO/GPIO_EXTI/Inc/main.h * @author MCD Application Team * @brief Header for main.c module ****************************************************************************** * @attention * * Copyright (c) 2016 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H /* Includes ------------------------------------------------------------------*/ #include "stm32f7xx_hal.h" #include "stm32f769i_discovery.h" /* Exported types ------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ /* Task state structure. In our simple scheduler, the task is determined only by its stack pointer and the start address (i.e. pointer to a function that implements the task) but in general, the structure should contain a task's state variable (flags) (e.g. RUNNING, STOPED, ACTIVE, ....) Pa3cio Bulic, 26.10.2021 */ typedef struct { void* sp; // task's stack pointer void (*pTask)(void); // start address of the task // int flags; } task_table_t; /* Hardware Stack Frame structure. Pa3cio Bulic, 26.10.2021 */ typedef struct { uint32_t r0; uint32_t r1; uint32_t r2; uint32_t r3; uint32_t r12; uint32_t lr; uint32_t pc; uint32_t psr; } hw_stack_frame_t; /* Exported constants --------------------------------------------------------*/ #define MAX_TASKS 4 // število opravil #define TASKS_STACK_SIZE 256 // velikost skladu za eno opravilo merjena v 4B /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void create_task (int task_id, void* task_stack_base_address, void (*pTask)(void)); void init_tasks (void); void switch_context (void); void Opravilo1 (void); void Opravilo2 (void); void Opravilo3 (void); void Opravilo0 (void); #endif /* __MAIN_H */