diff --git a/src/main/target/KISSFC/config.c b/src/main/target/KISSFC/config.c new file mode 100755 index 000000000..64d8ac31e --- /dev/null +++ b/src/main/target/KISSFC/config.c @@ -0,0 +1,52 @@ +/* + * This file is part of Cleanflight. + * + * Cleanflight is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Cleanflight is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Cleanflight. If not, see . + */ + +#include +#include + +#include + +#include "common/utils.h" + +#include "drivers/io.h" + +#include "fc/rc_controls.h" + +#include "flight/failsafe.h" +#include "flight/mixer.h" +#include "flight/pid.h" + +#include "rx/rx.h" + +#include "config/config_profile.h" +#include "config/config_master.h" + +#include "sensors/boardalignment.h" + + +void targetConfiguration(master_t *config) +{ + UNUSED(config); + +#ifdef KISSCC + // alternative defaults settings for Beebrain target + config->boardAlignment.rollDegrees = 180; + config->boardAlignment.pitchDegrees = 0; + config->boardAlignment.yawDegrees = 0; +#endif +} + diff --git a/src/main/target/KISSFC/target.c b/src/main/target/KISSFC/target.c index 0832a9900..0e97beb87 100644 --- a/src/main/target/KISSFC/target.c +++ b/src/main/target/KISSFC/target.c @@ -36,7 +36,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM2, CH1, PA15, TIM_USE_PWM, TIMER_INPUT_ENABLED), DEF_TIM(TIM2, CH3, PA2, TIM_USE_PWM, TIMER_INPUT_ENABLED), DEF_TIM(TIM2, CH4, PB11, TIM_USE_PWM, TIMER_INPUT_ENABLED), - DEF_TIM(TIM16,CH1N,PA13, TIM_USE_PWM, TIMER_INPUT_ENABLED), // KISSCC new softserial? + //DEF_TIM(TIM16,CH1N,PA13, TIM_USE_PWM, TIMER_INPUT_ENABLED), // KISSCC bidirectional softserial needs to be added #else DEF_TIM(TIM1, CH2N,PB14, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED), DEF_TIM(TIM8, CH2N,PB0, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED), diff --git a/src/main/target/KISSFC/target.h b/src/main/target/KISSFC/target.h index 4960cb30e..55bf32639 100644 --- a/src/main/target/KISSFC/target.h +++ b/src/main/target/KISSFC/target.h @@ -38,7 +38,17 @@ #define MPU_INT_EXTI PB2 #define USE_MPU_DATA_READY_SIGNAL #define ENSURE_MPU_DATA_READY_IS_LOW +#ifdef KISSCC +#define TARGET_CONFIG +#define GYRO +#define USE_GYRO_MPU6050 +#define GYRO_MPU6050_ALIGN CW90_DEG + +#define ACC +#define USE_ACC_MPU6050 +#define ACC_MPU6050_ALIGN CW90_DEG +#else #define GYRO #define USE_GYRO_MPU6050 #define GYRO_MPU6050_ALIGN CW180_DEG @@ -46,18 +56,14 @@ #define ACC #define USE_ACC_MPU6050 #define ACC_MPU6050_ALIGN CW180_DEG +#endif #define USE_SOFTSERIAL #define USE_VCP #define USE_UART1 #define USE_UART2 #define USE_UART3 -#ifdef KISSCC -#define USE_SOFTSERIAL1 -#define SERIAL_PORT_COUNT 5 -#else #define SERIAL_PORT_COUNT 4 -#endif #define UART1_TX_PIN PA9 #define UART1_RX_PIN PA10 @@ -68,11 +74,13 @@ #define UART3_TX_PIN PB10 // PB10 (AF7) #define UART3_RX_PIN PB11 // PB11 (AF7) +/* Fix this when Softserial is supported on single pin and add 1 more serial port #ifdef KISSCC #define SOFTSERIAL_1_TIMER TIM16 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 11 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 11 #endif +*/ #define USE_I2C #define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA @@ -84,11 +92,7 @@ //#define CURRENT_METER_ADC_PIN PA5 //#define RSSI_ADC_PIN PB2 -#ifdef KISSCC -#define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_SOFTSERIAL | FEATURE_TELEMETRY) -#else #define DEFAULT_FEATURES FEATURE_VBAT -#endif #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART2 @@ -104,9 +108,5 @@ #define TARGET_IO_PORTD 0xffff #define TARGET_IO_PORTF (BIT(4)) -#ifdef KISSCC -#define USABLE_TIMER_CHANNEL_COUNT 11 -#else #define USABLE_TIMER_CHANNEL_COUNT 10 -#endif #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(15) | TIM_N(16) | TIM_N(17)) diff --git a/src/main/target/KISSFC/target.mk b/src/main/target/KISSFC/target.mk old mode 100644 new mode 100755