Skip to content

Commit

Permalink
changed control thread args
Browse files Browse the repository at this point in the history
  • Loading branch information
dnakhooda committed Jan 23, 2025
1 parent f7cc2d0 commit 755fad4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions Core/Inc/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
extern osThreadId_t control_handle;
extern const osThreadAttr_t control_attributes;

typedef struct {
pdu_t *pdu;
} control_args_t;

void vControl(void *param);

void control_fanbattbox_record(can_msg_t args);
Expand Down
4 changes: 2 additions & 2 deletions Core/Src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ static int fanBattBoxState = 0;

void vControl(void *param)
{
control_args_t *args = (control_args_t *)param;
pdu_t *pdu = (pdu_t *)param;

for (;;) {
write_fan_battbox(args->pdu, fanBattBoxState);
write_fan_battbox(pdu, fanBattBoxState);

osDelay(1000);
}
Expand Down
4 changes: 1 addition & 3 deletions Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,7 @@ int main(void)
assert(sm_director_handle);

/* Control File Thread */
control_args_t *control_args = malloc(sizeof(control_args_t));
control_args->pdu = pdu;
control_handle = osThreadNew(vControl, control_args, &control_attributes);
control_handle = osThreadNew(vControl, pdu, &control_attributes);
assert(control_handle);

/* USER CODE END RTOS_THREADS */
Expand Down

0 comments on commit 755fad4

Please sign in to comment.