SD on rev G

only:alphax-4chan
This commit is contained in:
rusefi 2023-05-07 09:59:52 -04:00
parent a40d8b3c0d
commit 599a97b3aa
3 changed files with 13 additions and 2 deletions

View File

@ -104,7 +104,7 @@ void setBoardConfigOverrides() {
setupVbatt();
int16_t hellenBoardId = engine->engineState.hellenBoardId;
// rev.D uses SPI1 pins for CAN2, but rev.E and later uses SPI1 for SD-card
// rev.D uses SPI1 pins for CAN2, but rev.E and later uses mega-module meaning SPI1 for SD-card
if (hellenBoardId != BOARD_ID_2chan_d) {
setHellenSdCardSpi1();
}

View File

@ -146,7 +146,13 @@ void setBoardConfigOverrides() {
// todo: do we need this conditional on boardId or not really?
setHellenMegaEnPin();
setHellenSdCardSpi2();
int16_t hellenBoardId = engine->engineState.hellenBoardId;
if (hellenBoardId == BOARD_ID_4chan_d || hellenBoardId == BOARD_ID_4chan_e || hellenBoardId == BOARD_ID_4chan_f) {
setHellenSdCardSpi2();
} else {
// rev G and newer uses hellen mega-module
setHellenSdCardSpi1();
}
setDefaultHellenAtPullUps();

View File

@ -13,6 +13,11 @@
#define BOARD_ID_2chan_e 112
#define BOARD_ID_2chan_f 115
#define BOARD_ID_4chan_d 103
#define BOARD_ID_4chan_e 105
#define BOARD_ID_4chan_f 113
#define BOARD_ID_4chan_g 203
void hellenWbo();
void setHellen144LedPins();