Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.c #361

Merged
merged 35 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2e8460c
Remove contactor handling and extraneous delays from main
Cam0Cow Sep 30, 2023
b6fd25e
Create CommandLine task in main.c
Cam0Cow Sep 30, 2023
183ab34
Merge branch 'master' into check_main
Cam0Cow Oct 27, 2023
ca360f5
Merge branch 'master' into check_main
Cam0Cow Nov 4, 2023
92ac207
changed ordering of task prios
IshDeshpa Nov 10, 2023
097caf3
Merge branch 'master' into check_main
IshDeshpa Nov 10, 2023
31e2d81
Merge branch 'master' into check_main
IshDeshpa Nov 25, 2023
e8c22a1
Actually switch to hard floats, remove duplicated flags
Cam0Cow Nov 25, 2023
fa89f23
disabled regen
IshDeshpa Nov 25, 2023
8b5a3db
Squashed commit of the following:
IshDeshpa Nov 25, 2023
7b16d4d
test commit
IshDeshpa Dec 2, 2023
5cb19e2
Changes from integration with BPS: uncommented initialization of Task…
KnockbackNemo Dec 3, 2023
8615137
test commit
IshDeshpa Dec 9, 2023
d3a4e90
Squashed commit of the following:
IshDeshpa Dec 13, 2023
8c3c16a
mostly working
IshDeshpa Dec 13, 2023
84a04c0
ReadTritium fixes
IshDeshpa Dec 13, 2023
e0c40ec
Squashed commit of the following:
IshDeshpa Dec 17, 2023
8d7e935
removed duplicates
IshDeshpa Dec 17, 2023
b5adbeb
Merge remote-tracking branch 'origin/master' into check_main
IshDeshpa Dec 17, 2023
c7808fa
fixed merge issue in SendTritium.c (closes #381)
IshDeshpa Dec 17, 2023
47d011f
moved macros from ReadCarCAN.c to ReadCarCAN.h so they are visible in…
IshDeshpa Dec 19, 2023
dd36bc4
fixed header comment so doxygen recognizes it
IshDeshpa Dec 19, 2023
929f242
changed lang to en
IshDeshpa Dec 19, 2023
a9a9b4e
created helper script for printing all sphinx references
IshDeshpa Dec 19, 2023
6c10365
updated readtritium docs
IshDeshpa Dec 19, 2023
96aab88
updated Minions.rst
IshDeshpa Dec 19, 2023
bf453fa
Revert mistakenly pushed docs commits.
IshDeshpa Dec 19, 2023
9c2e234
Removed redundant code
NathanielDelgado Dec 27, 2023
ea33372
Merge branch 'master' into check_main
IshDeshpa Dec 29, 2023
2bf5ea5
Apply suggestions from code review
IshDeshpa Jan 1, 2024
8a65d35
Merge branch 'master' into check_main
IshDeshpa Jan 1, 2024
c6c4cf1
Feature/GitHub workflow fix (#396)
IshDeshpa Jan 1, 2024
3f20813
addressed more review comments
IshDeshpa Jan 1, 2024
5b7314b
Apply suggestions from code review
IshDeshpa Jan 2, 2024
0b55f39
Apply suggestions from code review
IshDeshpa Jan 2, 2024
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
8 changes: 4 additions & 4 deletions Apps/Inc/Tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
#define TASK_SEND_TRITIUM_PRIO 4
#define TASK_READ_CAR_CAN_PRIO 5
#define TASK_UPDATE_DISPLAY_PRIO 6
#define TASK_SEND_CAR_CAN_PRIO 8
#define TASK_TELEMETRY_PRIO 9
#define TASK_DEBUG_DUMP_PRIO 10
#define TASK_COMMAND_LINE_PRIO 11
#define TASK_SEND_CAR_CAN_PRIO 7
#define TASK_TELEMETRY_PRIO 8
#define TASK_DEBUG_DUMP_PRIO 9
#define TASK_COMMAND_LINE_PRIO 10

/**
* Stack Sizes
Expand Down
61 changes: 33 additions & 28 deletions Apps/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "CAN_Queue.h"
#include "UpdateDisplay.h"

#define IGN_CONT_PERIOD 100

int main(void) {
// Disable interrupts
__disable_irq();
Expand Down Expand Up @@ -65,15 +63,9 @@ void Task_Init(void *p_arg){

// Start systick
OS_CPU_SysTickInit(SystemCoreClock / (CPU_INT32U) OSCfg_TickRate_Hz);
NathanielDelgado marked this conversation as resolved.
Show resolved Hide resolved

OSTimeDlyHMSM(0,0,5,0,OS_OPT_TIME_HMSM_STRICT,&err);

assertOSError(err);

// Initialize drivers
Pedals_Init();
OSTimeDlyHMSM(0,0,5,0,OS_OPT_TIME_HMSM_STRICT,&err);
OSTimeDlyHMSM(0,0,10,0,OS_OPT_TIME_HMSM_STRICT,&err);
BSP_UART_Init(UART_2);
CANbus_Init(CARCAN, (CANId_t*)carCANFilterList, NUM_CARCAN_FILTERS);
CANbus_Init(MOTORCAN, NULL, NUM_MOTORCAN_FILTERS);
IshDeshpa marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -85,6 +77,24 @@ void Task_Init(void *p_arg){
// Initialize applications
UpdateDisplay_Init();

// Initialize ReadTritium
OSTaskCreate(
(OS_TCB*)&ReadTritium_TCB,
(CPU_CHAR*)"ReadTritium",
(OS_TASK_PTR)Task_ReadTritium,
(void*)NULL,
(OS_PRIO)TASK_READ_TRITIUM_PRIO,
(CPU_STK*)ReadTritium_Stk,
(CPU_STK_SIZE)WATERMARK_STACK_LIMIT,
(CPU_STK_SIZE)TASK_READ_TRITIUM_STACK_SIZE,
(OS_MSG_QTY)0,
(OS_TICK)0,
(void*)NULL,
(OS_OPT)(OS_OPT_TASK_STK_CLR),
(OS_ERR*)&err
);
assertOSError(err);

// Initialize SendTritium
OSTaskCreate(
(OS_TCB*)&SendTritium_TCB,
Expand Down Expand Up @@ -139,16 +149,16 @@ void Task_Init(void *p_arg){
);
assertOSError(err);

// Initialize ReadTritium
// Initialize SendCarCAN
OSTaskCreate(
(OS_TCB*)&ReadTritium_TCB,
(CPU_CHAR*)"ReadTritium",
(OS_TASK_PTR)Task_ReadTritium,
(OS_TCB*)&SendCarCAN_TCB,
(CPU_CHAR*)"SendCarCAN",
(OS_TASK_PTR)Task_SendCarCAN,
(void*)NULL,
(OS_PRIO)TASK_READ_TRITIUM_PRIO,
(CPU_STK*)ReadTritium_Stk,
(OS_PRIO)TASK_SEND_CAR_CAN_PRIO,
IshDeshpa marked this conversation as resolved.
Show resolved Hide resolved
(CPU_STK*)SendCarCAN_Stk,
(CPU_STK_SIZE)WATERMARK_STACK_LIMIT,
(CPU_STK_SIZE)TASK_READ_TRITIUM_STACK_SIZE,
(CPU_STK_SIZE)TASK_SEND_CAR_CAN_STACK_SIZE,
(OS_MSG_QTY)0,
(OS_TICK)0,
(void*)NULL,
Expand All @@ -157,16 +167,16 @@ void Task_Init(void *p_arg){
);
assertOSError(err);

// Initialize SendCarCAN
// Initialize CommandLine
OSTaskCreate(
(OS_TCB*)&SendCarCAN_TCB,
(CPU_CHAR*)"SendCarCAN",
(OS_TASK_PTR)Task_SendCarCAN,
(OS_TCB*)&CommandLine_TCB,
(CPU_CHAR*)"CommandLine",
(OS_TASK_PTR)Task_CommandLine,
(void*)NULL,
(OS_PRIO)TASK_SEND_CAR_CAN_PRIO,
(CPU_STK*)SendCarCAN_Stk,
(OS_PRIO)TASK_COMMAND_LINE_PRIO,
(CPU_STK*)CommandLine_Stk,
(CPU_STK_SIZE)WATERMARK_STACK_LIMIT,
(CPU_STK_SIZE)TASK_SEND_CAR_CAN_STACK_SIZE,
(CPU_STK_SIZE)TASK_COMMAND_LINE_STACK_SIZE,
(OS_MSG_QTY)0,
(OS_TICK)0,
(void*)NULL,
Expand All @@ -175,10 +185,5 @@ void Task_Init(void *p_arg){
);
assertOSError(err);


while(1){
Contactors_Set(MOTOR_CONTACTOR, Minions_Read(IGN_2), true); //turn on the contactor if the ign switch lets us
assertOSError(err);
OSTimeDlyHMSM(0, 0, 0, IGN_CONT_PERIOD, OS_OPT_TIME_HMSM_NON_STRICT, &err);
}
OSTaskDel(NULL, &err);
NathanielDelgado marked this conversation as resolved.
Show resolved Hide resolved
}
Loading