diff --git a/Core/Inc/msb_conf.h b/Core/Inc/msb_conf.h index 2877ed8..9037442 100644 --- a/Core/Inc/msb_conf.h +++ b/Core/Inc/msb_conf.h @@ -35,9 +35,20 @@ #define SENSOR_STRAIN //#define SENSOR_TOF -#define SENSOR_IMU +// #define SENSOR_IMU //NOTE // on knuckle or /wheel //#define SENSOR_WHEEL_TEMP // VERBOSE LOGGING #define LOG_VERBOSE + +//Note +//STACK SIZES +#define CAN_DISPATCH_STACK_SIZE 128 * 8 //can_dispatch_handle +#define LED_CONTROLLER_STACK_SIZE 32 * 8 //led_controller_handle +#define DEFAULT_TASK_STACK_SIZE 128 * 4 //defaultTaskHandle +#define TEMP_MONITOR_STACK_SIZE 64 * 8 //temp_monitor_handle +#define IMU_MONITOR_STACK_SIZE 64 * 8 //imu_monitor_handle +#define TOF_MONITOR_STACK_SIZE 128 * 8 //tof_monitor_handle +#define SHOCKPOT_MONITOR_STACK_SIZE 64 * 8 //shockpot_monitor_handle +#define STRAIN_MONITOR_STACK_SIZE 64 * 8 //strain_monitor_handle \ No newline at end of file diff --git a/Core/Src/can_handler.c b/Core/Src/can_handler.c index 373c666..9d06f54 100644 --- a/Core/Src/can_handler.c +++ b/Core/Src/can_handler.c @@ -45,7 +45,7 @@ void can1_init() osThreadId_t can_dispatch_handle; const osThreadAttr_t can_dispatch_attributes = { .name = "CanDispatch", - .stack_size = 128 * 8, + .stack_size = CAN_DISPATCH_STACK_SIZE, .priority = (osPriority_t)osPriorityRealtime5, }; diff --git a/Core/Src/controller.c b/Core/Src/controller.c index b981d50..9da09de 100644 --- a/Core/Src/controller.c +++ b/Core/Src/controller.c @@ -7,7 +7,7 @@ extern device_loc_t device_loc; osThreadId_t led_controller_handle; const osThreadAttr_t led_controller_attributes = { .name = "LedController", - .stack_size = 32 * 8, + .stack_size = LED_CONTROLLER_STACK_SIZE, .priority = (osPriority_t)osPriorityBelowNormal1, }; diff --git a/Core/Src/main.c b/Core/Src/main.c index 4a52f72..98f4818 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -64,7 +64,7 @@ UART_HandleTypeDef huart2; osThreadId_t defaultTaskHandle; const osThreadAttr_t defaultTask_attributes = { .name = "defaultTask", - .stack_size = 128 * 4, + .stack_size = DEFAULT_TASK_STACK_SIZE, .priority = (osPriority_t) osPriorityNormal, }; /* USER CODE BEGIN PV */ diff --git a/Core/Src/monitor.c b/Core/Src/monitor.c index 1098260..be0d425 100644 --- a/Core/Src/monitor.c +++ b/Core/Src/monitor.c @@ -34,7 +34,7 @@ uint16_t convert_can(uint16_t original_value, device_loc_t mode) osThreadId_t temp_monitor_handle; const osThreadAttr_t temp_monitor_attributes = { .name = "TempMonitor", - .stack_size = 64 * 16, + .stack_size = TEMP_MONITOR_STACK_SIZE, .priority = (osPriority_t)osPriorityHigh1, }; @@ -88,7 +88,7 @@ void vTempMonitor(void *pv_params) osThreadId_t imu_monitor_handle; const osThreadAttr_t imu_monitor_attributes = { .name = "IMUMonitor", - .stack_size = 64 * 8, + .stack_size = IMU_MONITOR_STACK_SIZE, .priority = (osPriority_t)osPriorityHigh, }; @@ -174,7 +174,7 @@ void vIMUMonitor(void *pv_params) osThreadId_t tof_monitor_handle; const osThreadAttr_t tof_monitor_attributes = { .name = "TOFMonitor", - .stack_size = 128 * 8, + .stack_size = TOF_MONITOR_STACK_SIZE, .priority = (osPriority_t)osPriorityHigh, }; @@ -213,7 +213,7 @@ void vTOFMonitor(void *pv_params) osThreadId_t shockpot_monitor_handle; const osThreadAttr_t shockpot_monitor_attributes = { .name = "ShockpotMonitor", - .stack_size = 64 * 8, + .stack_size = SHOCKPOT_MONITOR_STACK_SIZE, .priority = (osPriority_t)osPriorityHigh1, }; @@ -251,7 +251,7 @@ void vShockpotMonitor(void *pv_params) osThreadId_t strain_monitor_handle; const osThreadAttr_t strain_monitor_attributes = { .name = "StrainMonitor", - .stack_size = 64 * 8, + .stack_size = STRAIN_MONITOR_STACK_SIZE, .priority = (osPriority_t)osPriorityHigh1, };