more f429 business (#4679)
* 429 boots and LEDs work * oops missed a comma * enable on f767 too, since it should be the same board * why not just completely duplicate it * script should not be fancy * script should not be fancy * correct pins * h743 while we're at it
This commit is contained in:
parent
b7db5f90c3
commit
6e3efed09c
|
@ -67,6 +67,38 @@
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Build Firmware (Nucleo F429)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "make -j12 PROJECT_BOARD=nucleo_f429",
|
||||||
|
"windows": {
|
||||||
|
"command": "wsl bash -lc 'make -j12 PROJECT_BOARD=nucleo_f429'"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceRoot}/firmware"
|
||||||
|
},
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build Firmware (Nucleo H743)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "make -j12 PROJECT_BOARD=nucleo_h743 PROJECT_CPU=ARCH_STM32H7",
|
||||||
|
"windows": {
|
||||||
|
"command": "wsl bash -lc 'make -j12 PROJECT_BOARD=nucleo_h743 PROJECT_CPU=ARCH_STM32H7'"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceRoot}/firmware"
|
||||||
|
},
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Build Firmware (Atlas H7)",
|
"label": "Build Firmware (Atlas H7)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
@ -99,6 +131,22 @@
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Build Firmware (nissan 121)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "make -j16 PROJECT_BOARD=hellen/hellen121nissan",
|
||||||
|
"windows": {
|
||||||
|
"command": "wsl bash -lc 'make -j12 PROJECT_BOARD=hellen/hellen121nissan'"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"cwd": "${workspaceRoot}/firmware"
|
||||||
|
},
|
||||||
|
"problemMatcher": [],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Build Firmware (microRusEfi F4)",
|
"label": "Build Firmware (microRusEfi F4)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f429/board_configuration.cpp
|
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f429/board_configuration.cpp
|
||||||
BOARDINC = $(PROJECT_DIR)/config/boards/nucleo_f429
|
BOARDINC = $(PROJECT_DIR)/config/boards/nucleo_f429
|
||||||
|
|
||||||
DDEFS += -DEFI_FILE_LOGGING=FALSE
|
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
|
||||||
|
|
||||||
# Enable ethernet
|
# Enable ethernet
|
||||||
LWIP = yes
|
LWIP = yes
|
||||||
|
@ -12,3 +12,4 @@ DDEFS += -DEFI_ETHERNET=TRUE
|
||||||
IS_STM32F429 = yes
|
IS_STM32F429 = yes
|
||||||
|
|
||||||
DDEFS += -DFIRMWARE_ID=\"nucleo_f429\"
|
DDEFS += -DFIRMWARE_ID=\"nucleo_f429\"
|
||||||
|
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
|
void setBoardConfigOverrides() {
|
||||||
|
// PB14 is error LED, configured in board.mk
|
||||||
|
engineConfiguration->communicationLedPin = Gpio::B7;
|
||||||
|
engineConfiguration->runningLedPin = Gpio::B0;
|
||||||
|
|
||||||
|
// Board only has 3 LEDs
|
||||||
|
engineConfiguration->warningLedPin = Gpio::Unassigned;
|
||||||
|
}
|
||||||
|
|
||||||
|
void preHalInit() {
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A2, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A7, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::B13, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C1, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C4, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C5, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::G11, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::G13, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
}
|
|
@ -5,18 +5,4 @@
|
||||||
SCRIPT_NAME="compile_nucleo_f429.sh"
|
SCRIPT_NAME="compile_nucleo_f429.sh"
|
||||||
echo "Entering $SCRIPT_NAME"
|
echo "Entering $SCRIPT_NAME"
|
||||||
|
|
||||||
# Nucleo boards use MCO signal from St-Link and NOT oscillator - these need STM32_HSE_BYPASS
|
|
||||||
|
|
||||||
export USE_FATFS=no
|
|
||||||
|
|
||||||
export EXTRA_PARAMS="-DDUMMY \
|
|
||||||
-DEFI_INJECTOR_PIN3=Gpio::Unassigned \
|
|
||||||
-DSTM32_HSE_BYPASS=TRUE \
|
|
||||||
\
|
|
||||||
-DEFI_COMMUNICATION_PIN=Gpio::B7 \
|
|
||||||
-DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14 \
|
|
||||||
-DEFI_ENABLE_ASSERTS=FALSE \
|
|
||||||
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
|
||||||
export DEBUG_LEVEL_OPT="-O2"
|
|
||||||
|
|
||||||
bash ../common_make.sh nucleo_f429 ARCH_STM32F4
|
bash ../common_make.sh nucleo_f429 ARCH_STM32F4
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
# List of all the board related files.
|
# List of all the board related files.
|
||||||
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f767/board_configuration.cpp
|
|
||||||
|
# F429 and F767 Nucleo are indeed the same board with a different chip fitted - so recycle the F429 config
|
||||||
|
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f429/board_configuration.cpp
|
||||||
|
|
||||||
# reducing flash consumption for EFI_ETHERNET to fit
|
# reducing flash consumption for EFI_ETHERNET to fit
|
||||||
DDEFS += -DEFI_FILE_LOGGING=FALSE -DEFI_ALTERNATOR_CONTROL=FALSE -DEFI_LOGIC_ANALYZER=FALSE -DEFI_ENABLE_ASSERTS=FALSE
|
DDEFS += -DEFI_FILE_LOGGING=FALSE -DEFI_ALTERNATOR_CONTROL=FALSE -DEFI_LOGIC_ANALYZER=FALSE -DEFI_ENABLE_ASSERTS=FALSE
|
||||||
|
|
||||||
|
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
|
||||||
|
|
||||||
|
# Enable ethernet
|
||||||
LWIP = yes
|
LWIP = yes
|
||||||
DDEFS += -DEFI_ETHERNET=TRUE
|
DDEFS += -DEFI_ETHERNET=TRUE
|
||||||
|
|
||||||
DDEFS += -DSTM32F767xx
|
DDEFS += -DFIRMWARE_ID=\"nucleo_f767\"
|
||||||
|
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
/**
|
|
||||||
* @file boards/NUCLEO_F767/board_configuration.cpp
|
|
||||||
*
|
|
||||||
* @brief In this file we can override engine_configuration.cpp.
|
|
||||||
*
|
|
||||||
* @author andreika, (c) 2018
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "pch.h"
|
|
||||||
|
|
||||||
// Warning! This is a test config!
|
|
||||||
|
|
||||||
#undef SERIAL_SPEED
|
|
||||||
#define SERIAL_SPEED 115200
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Board-specific configuration defaults.
|
|
||||||
* @todo Add your board-specific code, if any.
|
|
||||||
*/
|
|
||||||
void setBoardDefaultConfiguration() {
|
|
||||||
engineConfiguration->binarySerialTxPin = Gpio::D8;
|
|
||||||
engineConfiguration->binarySerialRxPin = Gpio::D9;
|
|
||||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
|
||||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
|
||||||
|
|
||||||
engineConfiguration->runningLedPin = Gpio::B0; //green LED
|
|
||||||
engineConfiguration->warningLedPin = Gpio::Unassigned;
|
|
||||||
#if 0
|
|
||||||
engineConfiguration->vbattAdcChannel = EFI_ADC_13;
|
|
||||||
engineConfiguration->adcVcc = ADC_VCC;
|
|
||||||
#endif
|
|
||||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
|
||||||
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_NONE;
|
|
||||||
|
|
||||||
// not used
|
|
||||||
for (int i = 0; i < DIGIPOT_COUNT ; i++) {
|
|
||||||
engineConfiguration->digitalPotentiometerChipSelect[i] = Gpio::Unassigned;
|
|
||||||
}
|
|
||||||
engineConfiguration->triggerSimulatorPins[1] = Gpio::Unassigned;
|
|
||||||
engineConfiguration->triggerSimulatorPinModes[1] = OM_DEFAULT;
|
|
||||||
engineConfiguration->vehicleSpeedSensorInputPin = Gpio::Unassigned;
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
|
||||||
engineConfiguration->is_enabled_spi_1 = false;
|
|
||||||
engineConfiguration->is_enabled_spi_2 = false;
|
|
||||||
engineConfiguration->is_enabled_spi_3 = false;
|
|
||||||
}
|
|
|
@ -12,9 +12,6 @@ export USE_FATFS=no
|
||||||
export EXTRA_PARAMS="-DDUMMY -DSTM32F767xx \
|
export EXTRA_PARAMS="-DDUMMY -DSTM32F767xx \
|
||||||
-DEFI_INJECTOR_PIN3=Gpio::Unassigned \
|
-DEFI_INJECTOR_PIN3=Gpio::Unassigned \
|
||||||
-DSTM32_HSE_BYPASS=TRUE \
|
-DSTM32_HSE_BYPASS=TRUE \
|
||||||
-DFIRMWARE_ID=\\\"nucleo767\\\" \
|
|
||||||
-DEFI_COMMUNICATION_PIN=Gpio::B7 \
|
|
||||||
-DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14 \
|
|
||||||
-DEFI_ENABLE_ASSERTS=FALSE \
|
-DEFI_ENABLE_ASSERTS=FALSE \
|
||||||
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
||||||
export DEBUG_LEVEL_OPT="-O2"
|
export DEBUG_LEVEL_OPT="-O2"
|
||||||
|
|
|
@ -2,12 +2,7 @@
|
||||||
|
|
||||||
# STM32F767 version of the firmware for F767ZI chip NOT on Nucleo board, with a real oscilattor
|
# STM32F767 version of the firmware for F767ZI chip NOT on Nucleo board, with a real oscilattor
|
||||||
|
|
||||||
export EXTRA_PARAMS="-DDUMMY -DSTM32F767xx \
|
export EXTRA_PARAMS="-DDUMMY -DEFI_ENABLE_ASSERTS=FALSE \
|
||||||
-DEFI_INJECTOR_PIN3=Gpio::Unassigned \
|
|
||||||
-DFIRMWARE_ID=\\\"board767\\\" \
|
|
||||||
-DEFI_COMMUNICATION_PIN=Gpio::B7 \
|
|
||||||
-DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14 \
|
|
||||||
-DEFI_ENABLE_ASSERTS=FALSE \
|
|
||||||
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
-DCH_DBG_ENABLE_CHECKS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
||||||
|
|
||||||
# Do not forget to comment out following line if looking to debug!
|
# Do not forget to comment out following line if looking to debug!
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
# List of all the board related files.
|
# List of all the board related files.
|
||||||
|
|
||||||
DDEFS = -DTS_NO_PRIMARY=0 \
|
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp
|
||||||
-DTS_PRIMARY_PORT=SD3 \
|
|
||||||
-DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::D8 \
|
|
||||||
-DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::D9 \
|
|
||||||
|
|
||||||
DDEFS += -DEFI_FILE_LOGGING=FALSE
|
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
|
||||||
|
|
||||||
|
# Enable ethernet
|
||||||
LWIP = yes
|
LWIP = yes
|
||||||
DDEFS += -DEFI_ETHERNET=TRUE
|
DDEFS += -DEFI_ETHERNET=TRUE
|
||||||
|
|
||||||
# Shared variables
|
DDEFS += -DFIRMWARE_ID=\"nucleo_h743\"
|
||||||
ALLCPPSRC += $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp
|
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||||
|
|
||||||
|
|
|
@ -1 +1,25 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
|
|
||||||
|
void setBoardConfigOverrides() {
|
||||||
|
// PB14 is error LED, configured in board.mk
|
||||||
|
engineConfiguration->communicationLedPin = Gpio::E1;
|
||||||
|
engineConfiguration->runningLedPin = Gpio::B0;
|
||||||
|
|
||||||
|
// Board only has 3 LEDs
|
||||||
|
engineConfiguration->warningLedPin = Gpio::Unassigned;
|
||||||
|
}
|
||||||
|
|
||||||
|
void preHalInit() {
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A2, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::A7, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::B13, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C1, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C4, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::C5, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
|
||||||
|
efiSetPadMode("Ethernet", Gpio::G11, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
efiSetPadMode("Ethernet", Gpio::G13, PAL_MODE_ALTERNATE(0xb));
|
||||||
|
}
|
||||||
|
|
|
@ -5,16 +5,4 @@
|
||||||
SCRIPT_NAME="compile_nucleo_h743.sh"
|
SCRIPT_NAME="compile_nucleo_h743.sh"
|
||||||
echo "Entering $SCRIPT_NAME"
|
echo "Entering $SCRIPT_NAME"
|
||||||
|
|
||||||
# Nucleo boards use MCO signal from St-Link and NOT oscillator - these need STM32_HSE_BYPASS
|
|
||||||
|
|
||||||
export USE_FATFS=no
|
|
||||||
|
|
||||||
export EXTRA_PARAMS="-DDUMMY \
|
|
||||||
-DEFI_INJECTOR_PIN3=Gpio::Unassigned \
|
|
||||||
-DSTM32_HSE_BYPASS=TRUE \
|
|
||||||
-DFIRMWARE_ID=\\\"nucleoH743\\\" \
|
|
||||||
-DEFI_COMMUNICATION_PIN=Gpio::B7 \
|
|
||||||
-DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14"
|
|
||||||
export DEBUG_LEVEL_OPT="-O2"
|
|
||||||
|
|
||||||
bash ../common_make.sh nucleo_h743 ARCH_STM32H7
|
bash ../common_make.sh nucleo_h743 ARCH_STM32H7
|
||||||
|
|
|
@ -81,23 +81,6 @@ struct EthernetThread : public TunerstudioThread {
|
||||||
static EthernetThread ethernetConsole;
|
static EthernetThread ethernetConsole;
|
||||||
|
|
||||||
void startEthernetConsole() {
|
void startEthernetConsole() {
|
||||||
#ifndef STM32H7
|
|
||||||
// TODO: why does this break H7? I thought the pins were the same?
|
|
||||||
efiSetPadMode("ETH_RMII_REF_CLK", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_MDIO", Gpio::A2, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_RMII_CRS_DV", Gpio::A7, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
|
|
||||||
efiSetPadMode("ETH_MDC", Gpio::C1, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_RMII_RXD0", Gpio::C4, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_RMII_RXD1", Gpio::C5, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
|
|
||||||
efiSetPadMode("ETH_RMII_RXD1", Gpio::D5, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
|
|
||||||
efiSetPadMode("ETH_RMII_TX_EN", Gpio::G11, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_RMII_TXD0", Gpio::G13, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
efiSetPadMode("ETH_RMII_TXD1", Gpio::G14, PAL_MODE_ALTERNATE(0xb));
|
|
||||||
#endif // STM32H7
|
|
||||||
|
|
||||||
ethernetConsole.start();
|
ethernetConsole.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,8 +295,7 @@ int L9779::spi_rw(uint16_t tx, uint16_t *rx_ptr)
|
||||||
*/
|
*/
|
||||||
int L9779::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
int L9779::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
uint16_t rxdata;
|
|
||||||
SPIDriver *spi = cfg->spi_bus;
|
SPIDriver *spi = cfg->spi_bus;
|
||||||
|
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
|
@ -312,7 +311,7 @@ int L9779::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
||||||
/* Slave Select assertion. */
|
/* Slave Select assertion. */
|
||||||
spiSelect(spi);
|
spiSelect(spi);
|
||||||
/* data transfer */
|
/* data transfer */
|
||||||
rxdata = spiPolledExchange(spi, tx[i]);
|
uint16_t rxdata = spiPolledExchange(spi, tx[i]);
|
||||||
|
|
||||||
if (rx)
|
if (rx)
|
||||||
rx[i] = rxdata;
|
rx[i] = rxdata;
|
||||||
|
|
|
@ -388,8 +388,7 @@ int Tle8888::spi_rw(uint16_t tx, uint16_t *rx_ptr)
|
||||||
*/
|
*/
|
||||||
int Tle8888::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
int Tle8888::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
uint16_t rxdata;
|
|
||||||
SPIDriver *spi = cfg->spi_bus;
|
SPIDriver *spi = cfg->spi_bus;
|
||||||
|
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
|
@ -413,7 +412,7 @@ int Tle8888::spi_rw_array(const uint16_t *tx, uint16_t *rx, int n)
|
||||||
/* Slave Select assertion. */
|
/* Slave Select assertion. */
|
||||||
spiSelect(spi);
|
spiSelect(spi);
|
||||||
/* data transfer */
|
/* data transfer */
|
||||||
rxdata = spiPolledExchange(spi, tx[i]);
|
uint16_t rxdata = spiPolledExchange(spi, tx[i]);
|
||||||
|
|
||||||
if (rx)
|
if (rx)
|
||||||
rx[i] = rxdata;
|
rx[i] = rxdata;
|
||||||
|
|
|
@ -40,7 +40,7 @@ static uint32_t getTimerCounts(size_t count) {
|
||||||
getOneCapture();
|
getOneCapture();
|
||||||
|
|
||||||
uint32_t firstCapture = getOneCapture();
|
uint32_t firstCapture = getOneCapture();
|
||||||
uint32_t lastCapture;
|
uint32_t lastCapture = 0;
|
||||||
|
|
||||||
for (size_t i = 0; i < count; i++)
|
for (size_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
#include "mpu_util.h"
|
#include "mpu_util.h"
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
// Maybe your board needs to do something special before HAL init
|
||||||
|
preHalInit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ChibiOS/RT initialization
|
* ChibiOS/RT initialization
|
||||||
*/
|
*/
|
||||||
|
@ -28,3 +31,5 @@ int main(void) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Weak linked default implementation (not necessarily required for all boards)
|
||||||
|
__attribute__((weak)) void preHalInit() { }
|
||||||
|
|
|
@ -9,3 +9,5 @@
|
||||||
|
|
||||||
__NO_RETURN void runRusEfi();
|
__NO_RETURN void runRusEfi();
|
||||||
__NO_RETURN void rebootNow();
|
__NO_RETURN void rebootNow();
|
||||||
|
|
||||||
|
void preHalInit();
|
||||||
|
|
Loading…
Reference in New Issue