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:
parent
3e92a8b38a
commit
59eecab421
|
@ -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.
|
||||
|
|
|
@ -77,7 +77,3 @@ void setBoardConfigurationOverrides(void) {
|
|||
|
||||
void setSdCardConfigurationOverrides(void) {
|
||||
}
|
||||
|
||||
void setAdcChannelOverrides(void) {
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -78,6 +78,3 @@ void setBoardConfigurationOverrides(void) {
|
|||
engineConfiguration->is_enabled_spi_2 = false;
|
||||
engineConfiguration->is_enabled_spi_3 = false;
|
||||
}
|
||||
|
||||
void setAdcChannelOverrides(void) {
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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!!!!!!!!!!
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
||||
# 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!
|
||||
|
|
|
@ -226,9 +226,6 @@ void setBoardConfigurationOverrides(void) {
|
|||
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
|
||||
}
|
||||
|
||||
void setAdcChannelOverrides(void) {
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* c-basic-indent: 4
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue