From 626fffb71206037954c8678efb4e5392bcad8e24 Mon Sep 17 00:00:00 2001 From: hrrr Date: Fri, 18 Sep 2015 23:49:14 +0200 Subject: [PATCH] Sparky updates --- src/main/drivers/gyro_sync.c | 2 +- src/main/io/serial_1wire.c | 7 +++++++ src/main/sensors/initialisation.c | 2 +- src/main/target/SPARKY/target.h | 10 ++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/gyro_sync.c b/src/main/drivers/gyro_sync.c index 08c848806..633b935b2 100644 --- a/src/main/drivers/gyro_sync.c +++ b/src/main/drivers/gyro_sync.c @@ -48,7 +48,7 @@ void gyroUpdateSampleRate(uint32_t looptime, uint8_t lpf, uint8_t syncGyroToLoop int minLooptime; if (syncGyroToLoop) { -#if defined(SPRACINGF3) || defined(ALIENWIIF3) || defined(NAZE32PRO) || defined(STM32F3DISCOVERY) || defined(CHEBUZZF3) || defined(PORT103R) || defined(MOTOLAB) +#if defined(SPRACINGF3) || defined(ALIENWIIF3) || defined(NAZE32PRO) || defined(STM32F3DISCOVERY) || defined(CHEBUZZF3) || defined(PORT103R) || defined(MOTOLAB) || defined(SPARKY) if (lpf == INV_FILTER_256HZ_NOLPF2) { gyroSamplePeriod = 125; diff --git a/src/main/io/serial_1wire.c b/src/main/io/serial_1wire.c index 892240b9b..7b90c2946 100644 --- a/src/main/io/serial_1wire.c +++ b/src/main/io/serial_1wire.c @@ -71,6 +71,13 @@ const escHardware_t escHardware[ESC_COUNT] = { { GPIOA, 2 }, { GPIOA, 3 }, { GPIOA, 8 } +#elif SPARKY + { GPIOB, 15 }, + { GPIOB, 14 }, + { GPIOA, 8 }, + { GPIOB, 0 }, + { GPIOA, 6 }, + { GPIOA, 2 } #endif }; diff --git a/src/main/sensors/initialisation.c b/src/main/sensors/initialisation.c index 728ba307b..db1f7c06d 100755 --- a/src/main/sensors/initialisation.c +++ b/src/main/sensors/initialisation.c @@ -122,7 +122,7 @@ const mpu6050Config_t *selectMPU6050Config(void) return &spRacingF3MPU6050Config; #endif -#ifdef MOTOLAB +#if defined(MOTOLAB) || defined(SPARKY) static const mpu6050Config_t MotolabF3MPU6050Config = { .gpioAHBPeripherals = RCC_AHBPeriph_GPIOA, .gpioPort = GPIOA, diff --git a/src/main/target/SPARKY/target.h b/src/main/target/SPARKY/target.h index d054055a8..6fe79fa42 100644 --- a/src/main/target/SPARKY/target.h +++ b/src/main/target/SPARKY/target.h @@ -28,6 +28,10 @@ #define USABLE_TIMER_CHANNEL_COUNT 11 +// MPU6050 interrupts +#define EXTI15_10_CALLBACK_HANDLER_COUNT 1 // MPU data ready +#define USE_MPU_DATA_READY_SIGNAL + // MPU 9150 INT connected to PA15, pulled up to VCC by 10K Resistor, contains MPU6050 and AK8975 in single component. #define GYRO #define USE_GYRO_MPU6050 @@ -151,6 +155,12 @@ #define WS2811_IRQ DMA1_Channel7_IRQn #endif +#define USE_SERIAL_1WIRE +#define ESC_COUNT 6 +#define S1W_TX_GPIO GPIOB +#define S1W_TX_PIN GPIO_Pin_6 +#define S1W_RX_GPIO GPIOB +#define S1W_RX_PIN GPIO_Pin_7 #define SPEKTRUM_BIND // USART2, PA3 -- 2.11.4.GIT