Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/rev2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ INIT_DIR = ../../init/rev2
COV_C_SOURCES = \
main.c \
error_contract.c \
scheduler_contract.c \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you removed this source file, so this will cause build errors

fin_calib.c \
flash_appa.c \
fsm_appa.c \
Expand All @@ -83,6 +84,8 @@ $(DRIVER_DIR)/buzzer/buzzer.c \
$(MOD_DIR)/commands/commands.c \
$(MOD_DIR)/error_sdr/error_sdr.c \
$(MOD_DIR)/math_sdr/math_sdr.c \
$(MOD_DIR)/scheduler/scheduler.c \
$(MOD_DIR)/pool_allocator/pool_allocator.c \
$(DRIVER_DIR)/flash/flash.c \
$(DRIVER_DIR)/ignition/ignition.c \
$(DRIVER_DIR)/imu/imu.c \
Expand Down Expand Up @@ -214,6 +217,8 @@ C_INCLUDES = \
-I$(MOD_DIR)/debug_sdr \
-I$(MOD_DIR)/error_sdr \
-I$(MOD_DIR)/math_sdr \
-I$(MOD_DIR)/scheduler \
-I$(MOD_DIR)/pool_allocator \
-I$(MOD_DIR)/telemetry \
-I$(DRIVER_DIR)/flash \
-I$(DRIVER_DIR)/ignition \
Expand Down
6 changes: 6 additions & 0 deletions app/rev2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include "servo.h"
#include "usb.h"
#include "gps.h"
#include "scheduler.h"

/* debug/emulator includes */
#ifdef EMULATOR
Expand All @@ -79,6 +80,7 @@ UART_HandleTypeDef huart4; /* GPS */
TIM_HandleTypeDef htim3; /* 123 PWM Timer */
TIM_HandleTypeDef htim2; /* 4 PWN Timer */
TIM_HandleTypeDef htim5; /* Microsecond Timer */
TIM_HandleTypeDef htim6; /* Scheduler Timer */
SPI_HandleTypeDef hspi4; /* LORA SPI */

/* GPS Data */
Expand Down Expand Up @@ -226,6 +228,7 @@ IMU_GPS_I2C_Init (); /* IMU and GPS */
FLASH_SPI_Init (); /* External flash chip */
BUZZER_TIM_Init (); /* Buzzer */
MICRO_TIM_Init (); /* Microsecond timer */
Scheduler_TIM_Init (); /* Task scheduler timer */

PWM4_TIM_Init (); /* PWM Timer for Servo 4 */
PWM123_TIM_Init (); /* PWM Timer for Servo 1,2,3 */
Expand All @@ -235,6 +238,9 @@ LORA_SPI_Init (); /* LoRa SPI */
/* Initialize the debug interface */
(void)debug_init( debug_writer, NULL );

/* Initialize the task scheduler */
scheduler_init();

/*------------------------------------------------------------------------------
External Hardware Initializations
------------------------------------------------------------------------------*/
Expand Down
3 changes: 3 additions & 0 deletions app/rev2/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ extern "C" {
#define COAST_DETECT_SAMPLES 3 /* does not need to be tuned per vehicle, our system should work for all */
#define COAST_DETECT_THRESHOLD 1.25

/* Schedueler pool size as amount of tasks */
#define SCHEDULER_POOL_MAX_TASKS ( 32U )

/*------------------------------------------------------------------------------
Typedefs
------------------------------------------------------------------------------*/
Expand Down
76 changes: 38 additions & 38 deletions auto/rev2/.mxproject

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions auto/rev2/Core/Inc/main.h
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2022 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.
*
******************************************************************************
*/
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32h7xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.h
* @brief : Header for main.c file.
* This file contains the common defines of the application.
******************************************************************************
* @attention
*
* Copyright (c) 2022 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.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32h7xx_hal.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
/* USER CODE END ET */
/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */
/* USER CODE END EC */
/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */
/* USER CODE END EM */
void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);
/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */
Loading
Loading