TEST_33816
This commit is contained in:
parent
d875899373
commit
ce2ec3d544
|
@ -661,6 +661,8 @@ case TOYOTA_JZS147:
|
|||
return "TOYOTA_JZS147";
|
||||
case VAG_18_TURBO:
|
||||
return "VAG_18_TURBO";
|
||||
case TEST_33816:
|
||||
return "TEST_33816";
|
||||
case VW_B6:
|
||||
return "VW_B6";
|
||||
case VW_ABA:
|
||||
|
|
|
@ -78,7 +78,7 @@ void setSdCardConfigurationOverrides(void) {
|
|||
engineConfiguration->is_enabled_spi_1 = false;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_1;
|
||||
engineConfiguration->sdCardCsPin = GPIOA_2;
|
||||
engineConfiguration->isSdCardEnabled = false;
|
||||
CONFIG(isSdCardEnabled) = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -514,3 +514,14 @@ void mreBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
engineConfiguration->injectionPins[2 - 1] = GPIOE_10;
|
||||
#endif /* BOARD_TLE8888_COUNT */
|
||||
}
|
||||
|
||||
void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
||||
|
||||
CONFIG(mc33816_cs) = GPIOD_7;
|
||||
CONFIG(mc33816_rstb) = GPIOD_5;
|
||||
CONFIG(mc33816_driven) = GPIOD_6;
|
||||
|
||||
CONFIG(isSdCardEnabled) = false;
|
||||
|
||||
CONFIG(mc33816spiDevice) = SPI_DEVICE_3;
|
||||
}
|
||||
|
|
|
@ -21,3 +21,4 @@ void setIssue898(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
|||
|
||||
void mreBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -203,7 +203,7 @@ void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
engineConfiguration->isHip9011Enabled = false;
|
||||
engineConfiguration->isSdCardEnabled = false;
|
||||
CONFIG(isSdCardEnabled) = false;
|
||||
|
||||
setMiataNA6_settings(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
setFuelTablesLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);
|
||||
setTimingLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);
|
||||
|
||||
engineConfiguration->isSdCardEnabled = false;
|
||||
CONFIG(isSdCardEnabled) = false;
|
||||
engineConfiguration->tpsMin = 740;
|
||||
engineConfiguration->tpsMax = 135;
|
||||
}
|
||||
|
|
|
@ -805,6 +805,8 @@ case TOYOTA_JZS147:
|
|||
return "TOYOTA_JZS147";
|
||||
case VAG_18_TURBO:
|
||||
return "VAG_18_TURBO";
|
||||
case TEST_33816:
|
||||
return "TEST_33816";
|
||||
case VW_B6:
|
||||
return "VW_B6";
|
||||
case VW_ABA:
|
||||
|
|
|
@ -1301,6 +1301,9 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
|
|||
case TOYOTA_JZS147:
|
||||
setToyota_jzs147EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
case TEST_33816:
|
||||
setTest33816EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif // EFI_INCLUDE_ENGINE_PRESETS
|
||||
default:
|
||||
warning(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType);
|
||||
|
|
|
@ -193,6 +193,8 @@ typedef enum {
|
|||
SUBARUEJ20G_DEFAULTS = 101,
|
||||
VAG_18_TURBO = 102,
|
||||
|
||||
TEST_33816 = 103,
|
||||
|
||||
Force_4_bytes_size_engine_type = ENUM_32_BITS,
|
||||
} engine_type_e;
|
||||
|
||||
|
|
|
@ -507,7 +507,7 @@ void initHardware(Logging *l) {
|
|||
initOutputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_MC33816
|
||||
initMc33816();
|
||||
initMc33816(sharedLogger);
|
||||
#endif /* EFI_MC33816 */
|
||||
|
||||
#if EFI_MAX_31855
|
||||
|
|
|
@ -28,6 +28,9 @@ static OutputPin chipSelect;
|
|||
static OutputPin resetB;
|
||||
static OutputPin driven;
|
||||
|
||||
static unsigned short mcChipId;
|
||||
static Logging* logger;
|
||||
|
||||
static SPIConfig spiCfg = { .circular = false,
|
||||
.end_cb = NULL,
|
||||
.ssport = NULL,
|
||||
|
@ -43,7 +46,7 @@ static SPIDriver *driver;
|
|||
|
||||
|
||||
static void showStats() {
|
||||
|
||||
scheduleMsg(logger, "MC %d", mcChipId);
|
||||
}
|
||||
|
||||
// Mostly unused
|
||||
|
@ -71,7 +74,7 @@ static void spi_writew(unsigned short param) {
|
|||
//spiUnselect(driver);
|
||||
}
|
||||
|
||||
static unsigned short id() {
|
||||
static unsigned short readId() {
|
||||
spiSelect(driver);
|
||||
spi_writew(0xBAA1);
|
||||
unsigned short ID = recv_16bit_spi();
|
||||
|
@ -95,8 +98,7 @@ static void setup_spi() {
|
|||
spiUnselect(driver);
|
||||
}
|
||||
|
||||
static void enable_flash()
|
||||
{
|
||||
static void enable_flash() {
|
||||
spiSelect(driver);
|
||||
spi_writew(0x2001); //ch1
|
||||
spi_writew(0x0018); //enable flash
|
||||
|
@ -261,7 +263,8 @@ static void download_register(int r_target) {
|
|||
spiUnselect(driver);
|
||||
}
|
||||
|
||||
void initMc33816() {
|
||||
void initMc33816(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
// default spi3mosiPin PB5
|
||||
// default spi3misoPin PB4
|
||||
// default spi3sckPin PB3
|
||||
|
@ -296,7 +299,7 @@ void initMc33816() {
|
|||
|
||||
spiStart(driver, &spiCfg);
|
||||
|
||||
//addConsoleAction("mc33_stats", showStats);
|
||||
addConsoleAction("mc33_stats", showStats);
|
||||
//addConsoleActionI("mc33_send", sendWord);
|
||||
|
||||
// Does starting turn this high to begin with??
|
||||
|
@ -309,7 +312,7 @@ void initMc33816() {
|
|||
chThdSleepMilliseconds(10);
|
||||
|
||||
setup_spi();
|
||||
int mc_id = id();
|
||||
mcChipId = readId();
|
||||
|
||||
download_RAM(CODE_RAM1); // transfers code RAM1
|
||||
download_RAM(CODE_RAM2); // transfers code RAM2
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "global.h"
|
||||
|
||||
const int MAX_SPI_MODE_A_TRANSFER_SIZE = 31; //max size for register config transfer
|
||||
|
||||
enum {
|
||||
|
@ -22,5 +24,5 @@ enum {
|
|||
REG_DIAG
|
||||
};
|
||||
|
||||
void initMc33816(void);
|
||||
void initMc33816(Logging *logger);
|
||||
|
||||
|
|
Loading…
Reference in New Issue