Skip to content

Commit

Permalink
Thread Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dnakhooda committed Jan 17, 2025
1 parent fe623d3 commit e9e86f0
Show file tree
Hide file tree
Showing 3 changed files with 488 additions and 511 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
pdu_t *pdu;
} control_args_t;

void vEval_fanbattbox_state(void *param);
void vControl(void *param);

void control_fanbattbox_record(can_msg_t args);

Expand Down
13 changes: 5 additions & 8 deletions Core/Src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ const osThreadAttr_t control_attributes = {

static int fanBattBoxState = 0;

void vEval_fanbattbox_state(void *param)
void vControl(void *param)
{
control_args_t *args = (control_args_t *)param;

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

osDelay(1000);
osDelay(1000);
}
}

void control_fanbattbox_record(can_msg_t msg)
Expand All @@ -27,8 +29,3 @@ void control_fanbattbox_record(can_msg_t msg)
fanBattBoxState = 0;
}
}

int eval_fanbattbox_state()
{
return fanBattBoxState;
}
Loading

0 comments on commit e9e86f0

Please sign in to comment.