Make CAN work

This commit is contained in:
2023-03-08 20:20:01 +01:00
parent 81b7a23a34
commit 0ddea60a50
13 changed files with 227 additions and 74 deletions

View File

@ -30,6 +30,7 @@
#include "tx_api.h"
#include "tx_port.h"
#include "ui.h"
#include "vehicle.h"
/* USER CODE END Includes */
@ -64,6 +65,7 @@ static TX_BYTE_POOL tx_app_byte_pool;
/* USER CODE BEGIN PV */
TX_THREAD app_thread;
TX_THREAD ui_thread;
TX_THREAD vehicle_thread;
TX_QUEUE gui_button_queue;
/* USER CODE END PV */
@ -179,6 +181,15 @@ VOID tx_application_define(VOID *first_unused_memory) {
Error_Handler();
}
void *vehicle_thread_stack = mem;
mem += THREAD_STACK_SIZE;
if (tx_thread_create(&vehicle_thread, "Vehicle Thread", vehicle_thread_entry,
&hfdcan1, vehicle_thread_stack, THREAD_STACK_SIZE,
THREAD_PRIO_VEHICLE, THREAD_PRIO_VEHICLE, 0,
TX_AUTO_START) != TX_SUCCESS) {
Error_Handler();
}
if (MX_TouchGFX_Init(mem) != TX_SUCCESS) {
Error_Handler();
}

View File

@ -45,6 +45,7 @@ extern "C" {
#define THREAD_PRIO_APP 10
#define THREAD_PRIO_UI 6
#define THREAD_PRIO_VEHICLE 7
#define UI_QUEUE_SIZE 10
/* USER CODE END EC */