prep proteus config for h7 (#2413)

* prep for h7

* weak link that

* make those weak

* remove other stubs

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2021-02-28 11:57:57 -10:00 committed by GitHub
parent 3e92a8b38a
commit 59eecab421
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 28 additions and 59 deletions

View File

@ -169,9 +169,6 @@ void setBoardConfigurationOverrides(void) {
engineConfiguration->injectionMode = IM_SIMULTANEOUS;//IM_BATCH;// IM_SEQUENTIAL;
}
void setAdcChannelOverrides(void) {
}
/**
* @brief Board-specific SD card configuration code overrides. Needed by bootloader code.
* @todo Add your board-specific code, if any.

View File

@ -77,7 +77,3 @@ void setBoardConfigurationOverrides(void) {
void setSdCardConfigurationOverrides(void) {
}
void setAdcChannelOverrides(void) {
}

View File

@ -248,9 +248,6 @@ void setBoardConfigurationOverrides(void) {
engineConfiguration->injectionMode = IM_SIMULTANEOUS;//IM_BATCH;// IM_SEQUENTIAL;
}
void setAdcChannelOverrides(void) {
}
/**
* @brief Board-specific SD card configuration code overrides. Needed by bootloader code.
* @todo Add your board-specific code, if any.

View File

@ -78,6 +78,3 @@ void setBoardConfigurationOverrides(void) {
engineConfiguration->is_enabled_spi_2 = false;
engineConfiguration->is_enabled_spi_3 = false;
}
void setAdcChannelOverrides(void) {
}

View File

@ -27,19 +27,3 @@ void setSerialConfigurationOverrides(void) {
*/
void setSdCardConfigurationOverrides(void) {
}
/**
* @brief Board-specific ADC channel configuration code overrides.
* @todo Add your board-specific code, if any.
*/
void setAdcChannelOverrides(void) {
}
// TODO: fix analog inputs so we don't need these stubs
float getVoltage(const char*, adc_channel_e) {
return 0;
}
float getVoltageDivided(const char*, adc_channel_e) {
return 0;
}

View File

@ -1,14 +1,6 @@
#include "hal.h"
#include "stm32_gpio.h"
/**
* @brief Board-specific ADC channel configuration code overrides.
* @todo Add your board-specific code, if any.
*/
void setAdcChannelOverrides(void) {
}
#define PROMETHEUS_LED 13
// BLIIINK!!!!!!!!!!

View File

@ -14,6 +14,8 @@
#include "efilib.h"
#if USE_ADC3_VBATT_HACK
static ADCConversionGroup adcConvGroup = { FALSE, 1, nullptr, nullptr,
0,
ADC_CR2_SWSTART,
@ -51,3 +53,5 @@ void proteusAdcHack()
vbattSampleProteus = sum / efi::size(samples);
}
#endif /* USE_ADC3_VBATT_HACK */

View File

@ -1,11 +1,11 @@
# List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/proteus/board_configuration.cpp \
$(PROJECT_DIR)/config/boards/proteus/adc_hack.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/proteus
# Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
else
ifeq ($(PROJECT_CPU),ARCH_STM32F7)
PROTEUS_LEGACY = TRUE
endif
@ -17,8 +17,13 @@ DDEFS += -DEFI_ICU_INPUTS=FALSE -DHAL_TRIGGER_USE_PAL=TRUE
DDEFS += -DEFI_LOGIC_ANALYZER=FALSE
# todo: refactor HAL_VSS_USE_PAL
DDEFS += -DHAL_VSS_USE_PAL=TRUE
DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
# This stuff doesn't work on H7 yet
ifneq ($(PROJECT_CPU),ARCH_STM32H7)
DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
endif
DDEFS += -DEFI_CONSOLE_TX_BRAIN_PIN=GPIO_UNASSIGNED -DEFI_CONSOLE_RX_BRAIN_PIN=GPIO_UNASSIGNED
# We are running on Proteus hardware!

View File

@ -226,9 +226,6 @@ void setBoardConfigurationOverrides(void) {
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
}
void setAdcChannelOverrides(void) {
}
/*
* Local variables:
* c-basic-indent: 4

View File

@ -31,10 +31,3 @@ void setSerialConfigurationOverrides(void) {
*/
void setSdCardConfigurationOverrides(void) {
}
/**
* @brief Board-specific ADC channel configuration code overrides.
* @todo Add your board-specific code, if any.
*/
void setAdcChannelOverrides(void) {
}

View File

@ -180,13 +180,6 @@ bool mmc_lld_is_write_protected(MMCDriver *mmcp)
}
#endif
/**
* @brief Board-specific ADC channel configuration code overrides.
* @todo Add your board-specific code, if any.
*/
void setAdcChannelOverrides(void) {
}
#define STATUS_LED_PIN 8
#define STATUS_LED_PORT GPIOG

View File

@ -520,6 +520,9 @@ void removeChannel(const char *name, adc_channel_e setting) {
adcHwChannelEnabled[setting] = ADC_OFF;
}
// Weak link a stub so that every board doesn't have to implement this function
__attribute__((weak)) void setAdcChannelOverrides() { }
static void configureInputs(void) {
memset(adcHwChannelEnabled, 0, sizeof(adcHwChannelEnabled));
@ -616,4 +619,15 @@ void printFullAdcReportIfNeeded(Logging *logger) {
printFullAdcReport(logger);
}
#endif /* HAL_USE_ADC */
#else /* not HAL_USE_ADC */
__attribute__((weak)) float getVoltageDivided(const char*, adc_channel_e DECLARE_ENGINE_PARAMETER_SUFFIX) {
return 0;
}
// voltage in MCU universe, from zero to VDD
__attribute__((weak)) float getVoltage(const char*, adc_channel_e DECLARE_ENGINE_PARAMETER_SUFFIX) {
return 0;
}
#endif