parent
24fb167a34
commit
e0bb7ad581
|
@ -17,7 +17,7 @@ ifeq ($(CONFDIR),)
|
|||
endif
|
||||
|
||||
# disable some modules to shrink bootloader binary
|
||||
DDEFS += -DHAL_USE_ADC=FALSE -DHAL_USE_CAN=FALSE -DHAL_USE_EXT=FALSE -DHAL_USE_GPT=FALSE -DHAL_USE_I2C=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE -DHAL_USE_I2C=FALSE
|
||||
DDEFS += -DHAL_USE_ADC=FALSE -DHAL_USE_CAN=FALSE -DHAL_USE_EXT=FALSE -DHAL_USE_GPT=FALSE -DHAL_USE_ICU=FALSE -DHAL_USE_PWM=FALSE -DHAL_USE_RTC=FALSE
|
||||
#disable ChibiOS flsah driver and prevent header from include
|
||||
DDEFS += -DHAL_USE_FLASH=FALSE
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE FALSE /* TRUE */
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
#ifndef _HALCONF_PROMETHEUS_H_
|
||||
#define _HALCONF_PROMETHEUS_H_
|
||||
|
||||
#undef HAL_USE_I2C
|
||||
#define HAL_USE_I2C FALSE
|
||||
|
||||
#undef HAL_USE_SERIAL_USB
|
||||
#define HAL_USE_SERIAL_USB FALSE
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C TRUE
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -226,7 +226,7 @@
|
|||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -406,7 +406,7 @@
|
|||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#define USB_USE_WAIT FALSE
|
||||
#endif
|
||||
|
||||
#include "halconf_community.h"
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C TRUE
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -224,7 +224,7 @@
|
|||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -143,28 +143,6 @@ SPIDriver * getSpiDevice(spi_device_e spiDevice) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if HAL_USE_I2C
|
||||
#if defined(STM32F7XX)
|
||||
// values calculated with STM32CubeMX tool, 100kHz I2C clock for Nucleo-767 @168 MHz, PCK1=42MHz
|
||||
#define HAL_I2C_F7_100_TIMINGR 0x00A0A3F7
|
||||
static I2CConfig i2cfg = { HAL_I2C_F7_100_TIMINGR, 0, 0 }; // todo: does it work?
|
||||
#else /* defined(STM32F4XX) */
|
||||
static I2CConfig i2cfg = { OPMODE_I2C, 100000, STD_DUTY_CYCLE, };
|
||||
#endif /* defined(STM32F4XX) */
|
||||
|
||||
//static char txbuf[1];
|
||||
|
||||
static void sendI2Cbyte(int addr, int data) {
|
||||
(void)addr;
|
||||
(void)data;
|
||||
// i2cAcquireBus(&I2CD1);
|
||||
// txbuf[0] = data;
|
||||
// i2cMasterTransmit(&I2CD1, addr, txbuf, 1, NULL, 0);
|
||||
// i2cReleaseBus(&I2CD1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static Logging *sharedLogger;
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
@ -618,27 +596,10 @@ void initHardware(Logging *l) {
|
|||
initAdcDriver();
|
||||
#endif
|
||||
|
||||
#if HAL_USE_I2C
|
||||
addConsoleActionII("i2c", sendI2Cbyte);
|
||||
#endif
|
||||
|
||||
#if EFI_AUX_SERIAL
|
||||
initAuxSerial();
|
||||
#endif /* EFI_AUX_SERIAL */
|
||||
|
||||
// USBMassStorageDriver UMSD1;
|
||||
|
||||
// while (true) {
|
||||
// for (int addr = 0x20; addr < 0x28; addr++) {
|
||||
// sendI2Cbyte(addr, 0);
|
||||
// int err = i2cGetErrors(&I2CD1);
|
||||
// print("I2C: err=%x from %d\r\n", err, addr);
|
||||
// chThdSleepMilliseconds(5);
|
||||
// sendI2Cbyte(addr, 255);
|
||||
// chThdSleepMilliseconds(5);
|
||||
// }
|
||||
// }
|
||||
|
||||
#if EFI_VEHICLE_SPEED
|
||||
initVehicleSpeed(sharedLogger);
|
||||
#endif
|
||||
|
|
|
@ -106,19 +106,7 @@ static void lcd_HD44780_write(uint8_t data) {
|
|||
// LCD Pin RW -> P1
|
||||
// LCD Pin E -> P2
|
||||
|
||||
#if HAL_USE_I2C
|
||||
// todo: finish all this stuff
|
||||
i2cAcquireBus(&I2CD1);
|
||||
//
|
||||
// txbuf[0] = 4;
|
||||
// i2cMasterTransmit(&I2CD1, LCD_PORT_EXP_ADDR, txbuf, 1, NULL, 0);
|
||||
// lcdSleep(10); // enable pulse must be >450ns
|
||||
//
|
||||
// txbuf[0] = 0;
|
||||
// i2cMasterTransmit(&I2CD1, LCD_PORT_EXP_ADDR, txbuf, 1, NULL, 0);
|
||||
//
|
||||
i2cReleaseBus(&I2CD1);
|
||||
#endif /* HAL_USE_I2C */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Reference in New Issue