-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
190 brakelight control task, add task notifications to CAN I/O and ro…
…uters
- Loading branch information
Showing
15 changed files
with
121 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* @file control.h | ||
* @author Scott Abramson | ||
* @brief Tasks for controlling the car. | ||
* @version 0.1 | ||
* @date 2024-08-04 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
|
||
#ifndef CONTROL_H | ||
#define CONTROL_H | ||
|
||
#define BRAKE_STATE_UPDATE_FLAG 0x00000001U | ||
|
||
/** | ||
* @brief Task for controlling the brakelight. | ||
*/ | ||
void vBrakelightControl(void *pv_params); | ||
extern osThreadId brakelight_control_thread; | ||
extern const osThreadAttr_t brakelight_monitor_attributes; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @file control.c | ||
* @author Scott Abramson | ||
* @brief Tasks for controlling the car. | ||
* @version 0.1 | ||
* @date 2024-08-04 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
|
||
#include "pdu.h" | ||
#include "queues.h" | ||
#include "control.h" | ||
|
||
osThreadId brakelight_control_thread; | ||
const osThreadAttr_t brakelight_monitor_attributes = { | ||
.name = "BrakelightMonitor", | ||
.stack_size = 32 * 8, | ||
.priority = (osPriority_t)osPriorityHigh, | ||
}; | ||
|
||
void vBrakelightControl(void *pv_params) | ||
{ | ||
pdu_t *pdu = (pdu_t *)pv_params; | ||
|
||
for (;;) { | ||
osThreadFlagsWait(BRAKE_STATE_UPDATE_FLAG, osFlagsWaitAny, | ||
osWaitForever); | ||
write_brakelight(pdu, get_brake_state()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters