Fix KISSCC orientation // Remove unsupported softserial

This commit is contained in:
borisbstyle 2017-01-31 13:01:15 +01:00
parent 8e0dbc04ae
commit b7c1c58abb
4 changed files with 66 additions and 14 deletions

52
src/main/target/KISSFC/config.c Executable file
View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#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
}

View File

@ -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, CH1, PA15, TIM_USE_PWM, TIMER_INPUT_ENABLED),
DEF_TIM(TIM2, CH3, PA2, 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(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 #else
DEF_TIM(TIM1, CH2N,PB14, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED), DEF_TIM(TIM1, CH2N,PB14, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED),
DEF_TIM(TIM8, CH2N,PB0, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED), DEF_TIM(TIM8, CH2N,PB0, TIM_USE_MOTOR, TIMER_OUTPUT_ENABLED),

View File

@ -38,7 +38,17 @@
#define MPU_INT_EXTI PB2 #define MPU_INT_EXTI PB2
#define USE_MPU_DATA_READY_SIGNAL #define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW #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 GYRO
#define USE_GYRO_MPU6050 #define USE_GYRO_MPU6050
#define GYRO_MPU6050_ALIGN CW180_DEG #define GYRO_MPU6050_ALIGN CW180_DEG
@ -46,18 +56,14 @@
#define ACC #define ACC
#define USE_ACC_MPU6050 #define USE_ACC_MPU6050
#define ACC_MPU6050_ALIGN CW180_DEG #define ACC_MPU6050_ALIGN CW180_DEG
#endif
#define USE_SOFTSERIAL #define USE_SOFTSERIAL
#define USE_VCP #define USE_VCP
#define USE_UART1 #define USE_UART1
#define USE_UART2 #define USE_UART2
#define USE_UART3 #define USE_UART3
#ifdef KISSCC
#define USE_SOFTSERIAL1
#define SERIAL_PORT_COUNT 5
#else
#define SERIAL_PORT_COUNT 4 #define SERIAL_PORT_COUNT 4
#endif
#define UART1_TX_PIN PA9 #define UART1_TX_PIN PA9
#define UART1_RX_PIN PA10 #define UART1_RX_PIN PA10
@ -68,11 +74,13 @@
#define UART3_TX_PIN PB10 // PB10 (AF7) #define UART3_TX_PIN PB10 // PB10 (AF7)
#define UART3_RX_PIN PB11 // PB11 (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 #ifdef KISSCC
#define SOFTSERIAL_1_TIMER TIM16 #define SOFTSERIAL_1_TIMER TIM16
#define SOFTSERIAL_1_TIMER_RX_HARDWARE 11 #define SOFTSERIAL_1_TIMER_RX_HARDWARE 11
#define SOFTSERIAL_1_TIMER_TX_HARDWARE 11 #define SOFTSERIAL_1_TIMER_TX_HARDWARE 11
#endif #endif
*/
#define USE_I2C #define USE_I2C
#define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA #define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
@ -84,11 +92,7 @@
//#define CURRENT_METER_ADC_PIN PA5 //#define CURRENT_METER_ADC_PIN PA5
//#define RSSI_ADC_PIN PB2 //#define RSSI_ADC_PIN PB2
#ifdef KISSCC
#define DEFAULT_FEATURES (FEATURE_VBAT | FEATURE_SOFTSERIAL | FEATURE_TELEMETRY)
#else
#define DEFAULT_FEATURES FEATURE_VBAT #define DEFAULT_FEATURES FEATURE_VBAT
#endif
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART2 #define SERIALRX_UART SERIAL_PORT_USART2
@ -104,9 +108,5 @@
#define TARGET_IO_PORTD 0xffff #define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTF (BIT(4)) #define TARGET_IO_PORTF (BIT(4))
#ifdef KISSCC
#define USABLE_TIMER_CHANNEL_COUNT 11
#else
#define USABLE_TIMER_CHANNEL_COUNT 10 #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)) #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))

0
src/main/target/KISSFC/target.mk Normal file → Executable file
View File