Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cff39e3
Implement task creation for version sending
Pris1320 Oct 17, 2025
aad07b6
Add sendVersion task to main function
Pris1320 Oct 17, 2025
38b60ae
Implement sendVersion function for git hash transmission
Pris1320 Oct 17, 2025
7adfdc6
Implement sendVersion task for version reporting
Pris1320 Oct 17, 2025
67b89ae
Add task creation for sendVersion function
Pris1320 Oct 17, 2025
78ae0b0
Remove task creation for sendVersion
Pris1320 Oct 30, 2025
1a9694c
Change sendVersion to use SEND_ABOX_VERSION
Pris1320 Oct 30, 2025
6719683
Add task creation for sendVersion
Pris1320 Oct 31, 2025
0dc2eae
Change SEND_DASH_VERSION to SEND_pdu_VERSION
Pris1320 Oct 31, 2025
7087ed1
Change sendVersion function to use SEND_torque_vector_VERSION
Pris1320 Oct 31, 2025
413c8f3
Remove sendVersion task and function
Pris1320 Nov 4, 2025
0c5566b
Fix function name casing for SEND_PDU_VERSION
Pris1320 Nov 5, 2025
b93785b
Add sendVersion task to periodically send version info
Pris1320 Nov 5, 2025
b93edc2
Rename SEND_torque_vector_VERSION to SEND_TV_VERSION
Pris1320 Nov 5, 2025
a5f9bcd
Remove commented task for sendVersion
Pris1320 Nov 5, 2025
25d0150
Add task creation for sendVersion
Pris1320 Nov 5, 2025
a075a47
Remove commented code for sendVersion task
Pris1320 Nov 5, 2025
2dbebe5
Clean up commented code in main.c
Pris1320 Nov 5, 2025
359cb03
Remove unnecessary blank lines in main.c
Pris1320 Nov 7, 2025
8f6f00e
Use macro in send version taskCreate()
Pris1320 Nov 14, 2025
5c4b508
Use macro in taskCreate sendVersion
Pris1320 Nov 14, 2025
be24daa
Update taskCreate for sendVersion
Pris1320 Nov 14, 2025
1aae683
Update taskCreate for sendVersion
Pris1320 Nov 14, 2025
85d0ac2
Update taskCreate for sendVersion
Pris1320 Nov 14, 2025
f01be82
Update taskCreate sendVersion
Pris1320 Nov 14, 2025
9e3a90d
Update taskCreate for sendVersion
Pris1320 Nov 14, 2025
e466445
draft sendVersion and sendVersionTask functions
Pris1320 Nov 28, 2025
a864e21
remove sendVersion function and task
Pris1320 Nov 28, 2025
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: 8 additions & 0 deletions source/a_box/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ int main(void) {
taskCreate(monitorStatus, 50);
taskCreate(orionChargePeriodic, 50);
taskCreate(heartBeatTask, 100);
taskCreate(sendVersion, PERIOD_MILLISECONDS_ABOX_VERSION);

taskCreate(sendhbmsg, 500);
taskCreate(daqPeriodic, DAQ_UPDATE_PERIOD);
taskCreate(readCurrents, 50);
Expand Down Expand Up @@ -220,6 +222,12 @@ void preflightChecks(void) {
}
}

void sendVersion() {
char git_hash[8] = GIT_HASH;
uint64_t git_hash_num = EIGHT_CHAR_TO_U64_LE(git_hash);
SEND_ABOX_VERSION(git_hash_num);
}

void sendhbmsg() {
bool imd_status = !PHAL_readGPIO(IMD_STATUS_GPIO_Port, IMD_STATUS_Pin);

Expand Down
1 change: 0 additions & 1 deletion source/bootloader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ void CAN1_RX0_IRQHandler() {
void SysTick_Handler(void) {
bootloader_ms++;
}

void HardFault_Handler() {
NVIC_SystemReset();
while (1)
Expand Down
17 changes: 17 additions & 0 deletions source/daq/daq_hub/daq_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ defineThreadStack(daq_heartbeat, 500, osPriorityNormal, 128); // HB
defineThreadStack(sd_update_periodic, 100, osPriorityNormal, 4096); // SD WRITE
defineThreadStack(eth_update_periodic, 50, osPriorityNormal, 4096); // SD WRITE
defineThreadStack(can_send_periodic, 50, osPriorityNormal, 128); // CAN1 TX
defineThreadStack(sendVersionTask, PERIOD_MILLISECONDS_DAQ_VERSION, osPriorityLow, 128);


//defineThreadStack(uds_receive_periodic, 50, osPriorityHigh, 2048); // DAQ CAN RX

Expand Down Expand Up @@ -70,6 +72,7 @@ void daq_create_threads(void) {
createThread(sd_update_periodic); // SD WRITE
// createThread(eth_update_periodic); // SD WRITE
createThread(can_send_periodic); // CAN1 TX
createThread(sendVersionTask);
//createThread(uds_receive_periodic); // DAQ CAN RX
}

Expand All @@ -80,7 +83,21 @@ static void daq_heartbeat(void) {
SEND_DAQ_QUEUE_STATS(dh.bcan_rx_overflow, dh.can1_rx_overflow, dh.sd_rx_overflow, dh.tcp_tx_overflow); // TODO reset & only send once?
}
}
// added
void sendVersion() {
char git_hash[8] = GIT_HASH;
uint64_t git_hash_num = EIGHT_CHAR_TO_U64_LE(git_hash);
SEND_DAQ_VERSION(git_hash_num);
}

void sendVersionTask(void *pvParameters)
{
(void) pvParameters;

sendVersion();
vTaskDelay(pdMS_TO_TICKS(PERIOD_MILLISECONDS_DAQ_VERSION));
}
//
static void can_send_periodic(void) {
canTxUpdate();
}
Expand Down
2 changes: 1 addition & 1 deletion source/daq/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ bool can_parse_error_status(uint32_t err, timestamped_frame_t* frame);
void shutdown(void);

int main() {

osKernelInitialize();

bConstruct(&b_rx_can, sizeof(*can_rx_buffer), sizeof(can_rx_buffer));
Expand Down Expand Up @@ -178,7 +179,6 @@ int main() {
daq_create_threads();

osKernelStart();

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion source/dashboard/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int main(void) {
taskCreate(handleDashboardInputs, 50);
taskCreate(heartBeatTask, 100);
taskCreate(sendShockpots, 15);
taskCreate(sendVersion, 5000);
taskCreate(sendVersion, PERIOD_MILLISECONDS_DASH_VERSION);
// taskCreate(interpretLoadSensor, 15);
taskCreate(updateTelemetryPages, 200);
taskCreate(pollBrakeStatus, 1000);
Expand Down
7 changes: 6 additions & 1 deletion source/main_module/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ int main(void) {
taskCreate(update_lights, 500);
taskCreate(parseMCDataPeriodic, 15);
taskCreate(daqPeriodic, DAQ_UPDATE_PERIOD);
taskCreate(sendVersion, PERIOD_MILLISECONDS_MAIN_VERSION);

/* Background Tasks */
taskCreateBackground(canTxUpdate);
Expand Down Expand Up @@ -307,7 +308,11 @@ void preflightAnimation(void) {
break;
}
}

void sendVersion() {
char git_hash[8] = GIT_HASH;
uint64_t git_hash_num = EIGHT_CHAR_TO_U64_LE(git_hash);
SEND_MAIN_VERSION(git_hash_num);
}
void heartBeatLED(void) {
static uint8_t trig;
PHAL_toggleGPIO(HEARTBEAT_GPIO_Port, HEARTBEAT_Pin);
Expand Down
7 changes: 7 additions & 0 deletions source/pdu/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ int main() {
taskCreate(checkSwitchFaults, 100);
taskCreate(send_flowrates, 200);
schedStart();
taskCreate(sendVersion, PERIOD_MILLISECONDS_PDU_VERSION);
return 0;
}

Expand Down Expand Up @@ -260,6 +261,12 @@ void preflightChecks(void) {
}
}

void sendVersion() {
char git_hash[8] = GIT_HASH;
uint64_t git_hash_num = EIGHT_CHAR_TO_U64_LE(git_hash);
SEND_PDU_VERSION(git_hash_num);
}

void preflightAnimation(void) {
static uint32_t time;
static int led_number;
Expand Down
8 changes: 7 additions & 1 deletion source/torque_vector/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int main(void) {

taskCreateBackground(canTxUpdate);
taskCreateBackground(canRxUpdate);

taskCreate(sendVersion, PERIOD_MILLISECONDS_TV_VERSION);
taskCreate(heartBeatLED, 500);
taskCreate(heartBeatTask, 100);
taskCreate(parseIMU, 20);
Expand Down Expand Up @@ -272,6 +272,12 @@ void preflightChecks(void) {
}
}

void sendVersion() {
char git_hash[8] = GIT_HASH;
uint64_t git_hash_num = EIGHT_CHAR_TO_U64_LE(git_hash);
SEND_TV_VERSION(git_hash_num);
}

void preflightAnimation(void) {
static uint32_t time;

Expand Down