-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pd power seq implementation * pr feedback changes * pr feedback updates 2 * add bms relay state can msg
- Loading branch information
1 parent
dd2d000
commit 704016f
Showing
21 changed files
with
336 additions
and
126 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
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
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#pragma once | ||
|
||
#include "status.h" | ||
#include <stdint.h> | ||
|
||
#include "status.h" | ||
/* | ||
* @brief Checks for PD fault states and updates fault bitset CAN message | ||
* @return STATUS_CODE_OK on success or appropriate error code | ||
*/ | ||
StatusCode check_pd_fault(void); | ||
uint8_t check_pd_fault(void); |
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 |
---|---|---|
@@ -1,20 +1,32 @@ | ||
#pragma once | ||
|
||
#include "can.h" | ||
#include "exported_enums.h" | ||
#include "fsm.h" | ||
#include "log.h" | ||
#include "task.h" | ||
|
||
#define NUM_POWER_SEQ_STATES 5 | ||
#define NUM_POWER_SEQ_TRANSITIONS 9 | ||
// TODO: figure out actual values for timeout | ||
#define BMS_RESPONSE_TIMEOUT_MS 10000 | ||
#define MCI_RESPONSE_TIMEOUT_MS 12000 | ||
|
||
#define NUM_POWER_STATES 6 | ||
|
||
DECLARE_FSM(power_seq); | ||
typedef enum PowerSeqStateId { | ||
POWER_SEQ_INIT_STATE = 0, | ||
POWER_SEQ_EVERYTHING_ON, | ||
POWER_SEQ_DRIVER_CONTROLS, | ||
POWER_SEQ_MAIN_OPERATION, | ||
POWER_SEQ_AUX_POWER | ||
POWER_STATE_OFF = 0, | ||
TRANSMIT_BMS_CLOSE_RELAYS, | ||
POWER_STATE_ON, | ||
TURN_ON_DRIVE_OUTPUTS, | ||
POWER_STATE_DRIVE, | ||
POWER_STATE_FAULT, | ||
} PowerSeqStateId; | ||
|
||
typedef struct { | ||
PowerSeqStateId target_state; | ||
PowerSeqStateId latest_state; | ||
TickType_t timer_start_ticks; | ||
uint8_t fault; | ||
} PowerFsmContext; | ||
|
||
StatusCode init_power_seq(void); |
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
Oops, something went wrong.