1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

Merge pull request #3607 from AlienWiiBF/FortiniF4

Support for FORTINIF4 OSD revision
This commit is contained in:
Martin Budden 2017-07-23 10:38:00 +01:00 committed by GitHub
commit 3cd73f1a29
5 changed files with 105 additions and 1 deletions

View file

@ -21,10 +21,20 @@
#include <platform.h>
#ifdef TARGET_CONFIG
#include "fc/config.h"
#include "config/feature.h"
#include "telemetry/telemetry.h"
#include "hardware_revision.h"
void targetConfiguration(void)
{
if (hardwareRevision == FORTINIF4_REV_2) {
featureSet(FEATURE_OSD);
}
telemetryConfigMutable()->halfDuplex = false;
}
#endif

View file

@ -0,0 +1,53 @@
/*
* 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 <stdlib.h>
#include "platform.h"
#include "build/build_config.h"
#include "drivers/io.h"
#include "drivers/time.h"
#include "hardware_revision.h"
uint8_t hardwareRevision = FORTINIF4_UNKNOWN;
static IO_t HWDetectPin = IO_NONE;
void detectHardwareRevision(void)
{
HWDetectPin = IOGetByTag(IO_TAG(HW_PIN));
IOInit(HWDetectPin, OWNER_SYSTEM, 0);
IOConfigGPIO(HWDetectPin, IOCFG_IPU);
delayMicroseconds(10); // allow configuration to settle
// Check hardware revision
if (IORead(HWDetectPin)) {
hardwareRevision = FORTINIF4_REV_1;
} else {
hardwareRevision = FORTINIF4_REV_2;
}
}
void updateHardwareRevision(void)
{
}

View file

@ -0,0 +1,28 @@
/*
* 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/>.
*/
#pragma once
typedef enum ftf4HardwareRevision_t {
FORTINIF4_UNKNOWN = 0,
FORTINIF4_REV_1, // SPI Flash
FORTINIF4_REV_2 // OSD
} ftf4HardwareRevision_e;
extern uint8_t hardwareRevision;
void updateHardwareRevision(void);
void detectHardwareRevision(void);

View file

@ -19,6 +19,8 @@
#define TARGET_BOARD_IDENTIFIER "FORT"
#define USBD_PRODUCT_STRING "FortiniF4"
#define TARGET_CONFIG
#define USE_HARDWARE_REVISION_DETECTION
#define HW_PIN PC14
/*--------------LED----------------*/
#define LED0_PIN PB5
#define LED1_PIN PB6
@ -80,6 +82,15 @@
#define USE_FLASH_M25P16
/*---------------------------------*/
/*-------------OSD-----------------*/
#define OSD
#define USE_MAX7456
#define MAX7456_SPI_INSTANCE SPI3
#define MAX7456_SPI_CS_PIN PB3
#define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD*2)
#define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
/*---------------------------------*/
/*-----------USB-UARTs-------------*/
#define USE_VCP
//#define VBUS_SENSING_PIN PA8

View file

@ -5,4 +5,6 @@ TARGET_SRC = \
drivers/accgyro/accgyro_spi_mpu6000.c \
drivers/accgyro/accgyro_mpu6500.c \
drivers/accgyro/accgyro_spi_mpu6500.c \
drivers/accgyro/accgyro_spi_icm20689.c
drivers/accgyro/accgyro_spi_icm20689.c \
drivers/max7456.c