From d229bacc6039defbc9c75be96b091fa80c9600e4 Mon Sep 17 00:00:00 2001 From: blckmn Date: Sat, 22 Apr 2017 22:51:46 +1000 Subject: [PATCH] Updates for NERO. Fix for 20602, move i2c for LEDs Update the config for VCD to populate only 1 interface, and use device class allowing for built in Windows 10 driver. --- src/main/drivers/bus_spi_hal.c | 7 ++++++- src/main/target/NERO/target.h | 2 ++ src/main/vcp_hal/usbd_conf.h | 2 +- src/main/vcp_hal/usbd_desc.c | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/drivers/bus_spi_hal.c b/src/main/drivers/bus_spi_hal.c index 07e3ffcb0..14f19c61d 100644 --- a/src/main/drivers/bus_spi_hal.c +++ b/src/main/drivers/bus_spi_hal.c @@ -138,7 +138,12 @@ void spiInitDevice(SPIDevice device) spi->leadingEdge = true; } #endif - +#ifdef MPU6500_SPI_INSTANCE + if (spi->dev == MPU6500_SPI_INSTANCE) { + spi->leadingEdge = true; + } +#endif + // Enable SPI clock RCC_ClockCmd(spi->rcc, ENABLE); RCC_ResetCmd(spi->rcc, ENABLE); diff --git a/src/main/target/NERO/target.h b/src/main/target/NERO/target.h index 2c5c75443..67234d191 100644 --- a/src/main/target/NERO/target.h +++ b/src/main/target/NERO/target.h @@ -70,6 +70,8 @@ #define USE_I2C #define USE_I2C_DEVICE_1 #define I2C_DEVICE (I2CDEV_1) +#define I2C1_SCL PB8 +#define I2C1_SDA PB9 #define USE_VCP //#define VBUS_SENSING_PIN PA8 diff --git a/src/main/vcp_hal/usbd_conf.h b/src/main/vcp_hal/usbd_conf.h index cc9d10074..5bbd342e6 100644 --- a/src/main/vcp_hal/usbd_conf.h +++ b/src/main/vcp_hal/usbd_conf.h @@ -58,7 +58,7 @@ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Common Config */ -#define USBD_MAX_NUM_INTERFACES 1 +#define USBD_MAX_NUM_INTERFACES 0 #define USBD_MAX_NUM_CONFIGURATION 1 #define USBD_MAX_STR_DESC_SIZ 0x100 #define USBD_SUPPORT_USER_STRING 0 diff --git a/src/main/vcp_hal/usbd_desc.c b/src/main/vcp_hal/usbd_desc.c index 1d7075fd6..7da957d5e 100644 --- a/src/main/vcp_hal/usbd_desc.c +++ b/src/main/vcp_hal/usbd_desc.c @@ -98,7 +98,7 @@ __ALIGN_BEGIN uint8_t USBD_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = { USB_DESC_TYPE_DEVICE, /* bDescriptorType */ 0x00, /* bcdUSB */ 0x02, - 0x00, /* bDeviceClass */ + 0x02, /* bDeviceClass */ 0x00, /* bDeviceSubClass */ 0x00, /* bDeviceProtocol */ USB_MAX_EP0_SIZE, /* bMaxPacketSize */