1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-21 23:35:30 +03:00

Merge remote-tracking branch 'origin/development' into dzikuvx-mr-cruise-experiments

This commit is contained in:
Pawel Spychalski (DzikuVx) 2018-09-16 09:34:20 +02:00
commit 507b832263
72 changed files with 768 additions and 414 deletions

View file

@ -1,25 +0,0 @@
### If your issue looks like a hardware fault or a configuration problem please don't raise an issue here.
### Please consider using other user support options such as asking the manufacturer of the hardware you are using, [RCGroups](https://www.rcgroups.com/forums/showthread.php?t=2495732), [Slack](https://inavflight.signup.team) or other user support forums & groups (e.g. facebook).
### Board and Version
_Board name goes here. If you have a link where you've purchased the board - please include it_
_Version of INAV used goes here_
_Use CLI command `version` and put its output here_
_If it's a custom-compiled firmware please mention this_
### Behavior
* _Describe the problem_
* _Steps needed to reproduce the problem_
* _Expected Results_
* _Actual Results_
_Is this a new feature request?_
#### Blackbox logs/Config (.ZIP) where problem occurs
_Go to CLI, execute `dump` command copy its output to [PasteBin](https://pastebin.com) and provide a link to a paste here.
_Upload a zipped blackbox log (if available)_

32
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View file

@ -0,0 +1,32 @@
---
name: "\U0001F41B Bug report"
about: Report an issue to help make INAV better
---
## Current Behavior
<!-- If applicable, add screenshots, videos and blackbox logs to help explain your problem. -->
## Steps to Reproduce
<!-- Steps to reproduce the behavior: -->
1.
2.
3.
4.
## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->
## Suggested solution(s)
<!-- How could we solve this issue? What changes would need to made to INAV? -->
## Additional context
<!-- Add any other context about the problem here. -->
<!-- Go to CLI, execute `dump` command copy its output to [PasteBin](https://pastebin.com) and provide a link to a paste here -->
---
<!-- PLEASE FILL THIS OUT -->
<!-- Use CLI 'version' command to get version string -->
- FC Board name and vendor:
- INAV version string:

View file

@ -0,0 +1,21 @@
---
name: "\U0001F680Feature request"
about: Suggest a new feature for INAV
---
## Current Behavior
<!-- A clear and concise description of what is the current behavior / usecase. -->
## Desired Behavior
<!-- A clear and concise description of what you want to happen. -->
## Suggested Solution
<!-- Suggest a solution that the community/maintainers/you may take to enable the desired behavior -->
<!-- NOTE: Feature Requests without suggested solutions may not be addressed with the same level of urgency as those that have suggested solutions -->
## Who does this impact? Who is this for?
<!-- Who is this for? All users? Airplane users? Beginners? Advanced? Yourself? People using X, Y, Z, etc.? -->
## Additional context
<!-- Add any other context or links about the feature request here. -->

20
.github/ISSUE_TEMPLATE/Question.md vendored Normal file
View file

@ -0,0 +1,20 @@
---
name: "\U00002753Question"
about: Have a question?
---
For immediate help, just ask your question on one of the following platforms:
* [Telegram channel](https://t.me/INAVFlight)
* [Facebook group](https://www.facebook.com/groups/INAVOfficial)
* [RC Groups thread](https://www.rcgroups.com/forums/showthread.php?2495732-Cleanflight-iNav-%28navigation-rewrite%29-project)
* [IRC channel](irc://irc.freenode.net/#inavflight)
* [Slack channel](https://publicslack.com/slacks/inavflight/invites/new)
You can also read public documentations or watch video tutorials:
* [Official documentation](https://github.com/iNavFlight/inav/tree/master/docs)
* [Official Wiki](https://github.com/iNavFlight/inav/wiki)
* [Video series by Painless360](https://www.youtube.com/playlist?list=PLYsWjANuAm4qdXEGFSeUhOZ10-H8YTSnH)
* [Video series by Paweł Spychalski](https://www.youtube.com/playlist?list=PLOUQ8o2_nCLloACrA6f1_daCjhqY2x0fB)

View file

@ -28,7 +28,7 @@ before_install:
install:
- ./install-toolchain.sh
- export TOOLCHAINPATH=$PWD/gcc-arm-none-eabi-6-2017-q2-update/bin
- export TOOLCHAINPATH=$PWD/gcc-arm-none-eabi-7-2018-q2-update/bin
- export PATH=$TOOLCHAINPATH:$PATH
before_script:
@ -41,7 +41,7 @@ script: ./.travis.sh
cache:
apt: true
directories:
- $PWD/gcc-arm-none-eabi-6-2017-q2-update
- $PWD/gcc-arm-none-eabi-7-2018-q2-update
notifications:
#slack: inavflight:UWRoWFJ4cbbpHXT8HJJlAPXa

View file

@ -3,9 +3,11 @@ If you believe you should be on this list - feel free to open a PR updating it.
inclusion into this list please provide information about which part of code belongs to you.
Albert Kravcov
Alberto García Hierro
Alex Gorbatchev
Alex Zaitsev
Alexander Fedorov
Alexey Stankevich
Andre Bernet
Andreas Tacke
Andrew Payne
@ -30,6 +32,7 @@ Fredrik Steen
Gareth Wilkins
Gaël James
Gregor Ottmann
Google LLC
Hyon Lim
James Harrison
Jan Staal
@ -56,10 +59,12 @@ Max Winterstein
Michael Corcoran
Michael Hope
Michael Jakob
Michel Pastor
Miha Valencic
Mikael Blomqvist
Moritz Ulrich
Moshen Chan
Nathan Tsoi
Nicholas Sherlock
Paul Fertser
Paul Rogalinski
@ -77,8 +82,10 @@ Samuel Brucksch
Scott Shawcroft
Sean Vig
Stefan Grufman
Stefan Haubold
Steve Amor
Thomas Buck
Tim Eckel
Trey Marc
Tuomas Kuosmanen
Zap Andersson

46
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View file

@ -118,7 +118,7 @@ else
$(error Unknown target MCU specified.)
endif
GROUP_1_TARGETS := ALIENFLIGHTF3 ALIENFLIGHTF4 AIRHEROF3 AIRHEROF3_QUAD COLIBRI_RACE LUX_RACE SPARKY REVO SPARKY2 COLIBRI FALCORE FF_F35_LIGHTNING FF_FORTINIF4 FF_PIKOF4 FF_PIKOF4OSD
GROUP_1_TARGETS := ALIENFLIGHTF3 ALIENFLIGHTF4 AIRHEROF3 AIRHEROF3_QUAD COLIBRI_RACE LUX_RACE SPARKY REVO SPARKY2 COLIBRI KISSFC FALCORE FF_F35_LIGHTNING FF_FORTINIF4 FF_PIKOF4 FF_PIKOF4OSD
GROUP_2_TARGETS := SPRACINGF3 SPRACINGF3EVO SPRACINGF3EVO_1SS SPRACINGF3MINI SPRACINGF3NEO SPRACINGF4EVO CLRACINGF4AIR CLRACINGF4AIRV2 BEEROTORF4 BETAFLIGHTF3 BETAFLIGHTF4 PIKOBLX
GROUP_3_TARGETS := OMNIBUS AIRBOTF4 BLUEJAYF4 OMNIBUSF4 OMNIBUSF4PRO OMNIBUSF4V3 FIREWORKSV2 SPARKY2 MATEKF405 OMNIBUSF7 DYSF4PRO OMNIBUSF4PRO_LEDSTRIPM5 OMNIBUSF7NXT OMNIBUSF7V2 ASGARD32F4
GROUP_4_TARGETS := ANYFC ANYFCF7 ANYFCF7_EXTERNAL_BARO ANYFCM7 ALIENFLIGHTNGF7 PIXRACER YUPIF4 YUPIF4MINI YUPIF4R2 YUPIF7 MATEKF405SE MATEKF411 MATEKF722 MATEKF405OSD MATEKF405_SERVOS6
@ -224,6 +224,7 @@ CFLAGS += $(ARCH_FLAGS) \
-Werror=switch \
-ffunction-sections \
-fdata-sections \
-fno-common \
$(DEVICE_FLAGS) \
-DUSE_STDPERIPH_DRIVER \
$(TARGET_FLAGS) \

View file

@ -205,16 +205,17 @@ After restoring it's always a good idea to `dump` or `diff` the settings once ag
| spektrum_sat_bind | 0 | 0 = disabled. Used to bind the spektrum satellite to RX |
| telemetry_switch | OFF | Which aux channel to use to change serial output & baud rate (MSP / Telemetry). It disables automatic switching to Telemetry when armed. |
| telemetry_inverted | OFF | Determines if the telemetry protocol default signal inversion is reversed. This should be OFF in most cases unless a custom or hacked RX is used. |
| frsky_default_latitude | 0.000 | OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
| frsky_default_longitude | 0.000 | OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
| frsky_coordinates_format | 0 | FRSKY_FORMAT_DMS (default), FRSKY_FORMAT_NMEA |
| frsky_unit | METRIC | METRIC , IMPERIAL |
| frsky_vfas_precision | 0 | Set to 1 to send raw VBat value in 0.1V resolution for receivers that can handle it, or 0 (default) to use the standard method |
| frsky_pitch_roll | OFF | Send pitch and roll degrees*10 instead of raw accelerometer telemetry for S.Port and FrSky D-Series telemetry |
| report_cell_voltage | OFF | |
| frsky_unit | METRIC | Not used? [METRIC/IMPERIAL] |
| frsky_default_latitude | 0.000 | D-Series telemetry only: OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
| frsky_default_longitude | 0.000 | D-Series telemetry only: OpenTX needs a valid set of coordinates to show compass value. A fake value defined in this setting is sent while no fix is acquired. |
| frsky_coordinates_format | 0 | D-Series telemetry only: FRSKY_FORMAT_DMS (default), FRSKY_FORMAT_NMEA |
| frsky_vfas_precision | 0 | D-Series telemetry only: Set to 1 to send raw VBat value in 0.1V resolution for receivers that can handle it, or 0 (default) to use the standard method |
| frsky_pitch_roll | OFF | S.Port and D-Series telemetry: Send pitch and roll degrees*10 instead of raw accelerometer data |
| smartport_fuel_unit | MAH | S.Port telemetry only: Unit of the value sent with the `FUEL` ID (FrSky D-Series always sends precent). [PERCENT/MAH/MWH] |
| smartport_uart_unidir | OFF | S.Port telemetry only: Turn UART into UNIDIR for usage on F1 and F4 target. See Telemetry.md for details |
| report_cell_voltage | OFF | S.Port, D-Series, and IBUS telemetry: Send the average cell voltage if set to ON |
| hott_alarm_sound_interval | 5 | Battery alarm delay in seconds for Hott telemetry |
| smartport_uart_unidir | OFF | Turn UART into UNIDIR for smartport telemetry for usage on F1 and F4 target. See Telemetry.md for details |
| smartport_fuel_unit | MAH | Unit of the value sent with the `FUEL` ID through the S.Port and FrSky D-Series telemetry. [PERCENT/MAH/MWH] |
| smartport_fuel_unit | MAH | S.Port and D-Series telemetry: Unit of the value sent with the `FUEL` ID. [PERCENT/MAH/MWH] |
| ibus_telemetry_type | 0 | Type compatibility ibus telemetry for transmitters. See Telemetry.md label IBUS for details. |
| ltm_update_rate | NORMAL | Defines the LTM update rate (use of bandwidth [NORMAL/MEDIUM/SLOW]). See Telemetry.md, LTM section for details. |
| battery_capacity | 0 | Battery capacity in mAH. This value is used in conjunction with the current meter to determine remaining battery capacity. |
@ -300,6 +301,7 @@ After restoring it's always a good idea to `dump` or `diff` the settings once ag
| osd_alt_alarm | 100 | Value above which to make the OSD relative altitude indicator blink (meters) |
| osd_neg_alt_alarm | 5 | Value bellow which (negative altitude) to make the OSD relative altitude indicator blink (meters) |
| osd_estimations_wind_compensation | ON | Use wind estimation for remaining flight time/distance estimation |
| display_force_sw_blink | OFF | OFF = OSD hardware blink / ON = OSD software blink. If OSD warning text/values are invisible, try setting this to ON |
| magzero_x | 0 | Magnetometer calibration X offset. If its 0 none offset has been applied and calibration is failed. |
| magzero_y | 0 | Magnetometer calibration Y offset. If its 0 none offset has been applied and calibration is failed. |
| magzero_z | 0 | Magnetometer calibration Z offset. If its 0 none offset has been applied and calibration is failed. |
@ -421,5 +423,3 @@ After restoring it's always a good idea to `dump` or `diff` the settings once ag
| motor_decel_time | 0 | Minimum time for the motor(s) to deccelerate from 100 to 0% throttle (ms) [0-1000] |
| thr_comp_weight | 0.692 | Weight used for the throttle compensation based on battery voltage. See the [battery documentation](Battery.md#automatic-throttle-compensation-based-on-battery-voltage) |
This Markdown table is made by MarkdwonTableMaker addon for google spreadsheet.
Original Spreadsheet used to make this table can be found here https://docs.google.com/spreadsheets/d/1ubjYdMGmZ2aAMUNYkdfe3hhIF7wRfIjcuPOi_ysmp00/edit?usp=sharing

View file

@ -98,11 +98,11 @@ The following sensors are transmitted
* **VFAS** : actual vbat value.
* **Curr** : actual current comsuption, in amps.
* **Alt** : barometer based altitude, relative to home location.
* **Fuel** : if `battery_capacity` variable set and variable `smartport_fuel_percent = ON` remaining battery percentage, mAh drawn otherwise.
* **Fuel** : if `smartport_fuel_unit = PERCENT` remaining battery percentage sent, MAH drawn otherwise.
* **GPS** : GPS coordinates.
* **VSpd** : vertical speed, unit is cm/s.
* **Hdg** : heading, North is 0°, South is 180°.
* **AccX,Y,Z** : accelerometer values.
* **AccX,Y,Z** : accelerometer values (not sent if `frsky_pitch_roll = ON`).
* **Tmp1** : flight mode, sent as 5 digits. Number is sent as **ABCDE** detailed below. The numbers are additives (for example: if digit C is 6, it means both position hold and altitude hold are active) :
* **A** : 1 = flaperon mode, 2 = auto tune mode, 4 = failsafe mode
* **B** : 1 = return to home, 2 = waypoint mode, 4 = headfree mode
@ -118,6 +118,8 @@ The following sensors are transmitted
* **ASpd** : true air speed, from pitot sensor.
* **A4** : average cell value. Warning : unlike FLVSS and MLVSS sensors, you do not get actual lowest value of a cell, but an average : (total lipo voltage) / (number of cells)
* **0420** : distance to GPS home fix, in meters
* **0430** : if `frsky_pitch_roll = ON` set this will be pitch degrees*10
* **0440** : if `frsky_pitch_roll = ON` set this will be roll degrees*10
### Compatible SmartPort/INAV telemetry flight status
@ -160,10 +162,10 @@ This is new setting which supports VFAS resolution of 0.1 volts and is supported
### Notes
Many of the same SmartPort telemetry values listed above are also sent with FrSky D-Series telemetry.
RPM shows throttle output when armed.
RPM shows when disarmed.
TEMP2 shows Satellite Signal Quality when GPS is enabled.
RPM requires that the 'blades' setting is set to 12 on your receiver/display - tested with Taranis/OpenTX.
## HoTT telemetry

View file

@ -1,5 +1,5 @@
#!/bin/bash
if [ ! -d $PWD/gcc-arm-none-eabi-6_2-2016q4/bin ] ; then
curl --retry 10 --retry-max-time 120 -L "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2" | tar xfj -
if [ ! -d $PWD/gcc-arm-none-eabi-7-2018-q2-update/bin ] ; then
curl --retry 10 --retry-max-time 120 -L "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2" | tar xfj -
fi

View file

@ -817,7 +817,7 @@ HAL_StatusTypeDef USB_WritePacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *src, uin
count32b = (len + 3) / 4;
for (i = 0; i < count32b; i++, src += 4)
{
USBx_DFIFO(ch_ep_num) = *((__packed uint32_t *)src);
USBx_DFIFO(ch_ep_num) = *((uint32_t *)src);
}
}
return HAL_OK;
@ -843,7 +843,7 @@ void *USB_ReadPacket(USB_OTG_GlobalTypeDef *USBx, uint8_t *dest, uint16_t len)
for ( i = 0; i < count32b; i++, dest += 4 )
{
*(__packed uint32_t *)dest = USBx_DFIFO(0);
*(uint32_t *)dest = USBx_DFIFO(0);
}
return ((void *)dest);

View file

@ -15,3 +15,5 @@ RELEASE_TARGETS += OMNIBUSF4 OMNIBUSF4PRO OMNIBUSF4V3 OMNIBUSF4PRO_LEDSTRIPM5 DY
RELEASE_TARGETS += OMNIBUSF7 OMNIBUSF7V2 OMNIBUSF7NXT YUPIF7
RELEASE_TARGETS += MATEKF405 MATEKF405_SERVOS6 MATEKF405OSD MATEKF722 MATEKF405SE MATEKF411
RELEASE_TARGETS += SPEEDYBEEF4 FRSKYF3 FRSKYF4

View file

@ -18,6 +18,7 @@
#include "version.h"
const char * const targetName = __TARGET__;
const char * const compilerVersion = __VERSION__;
const char * const shortGitRevision = __REVISION__;
const char * const buildDate = __DATE__;
const char * const buildTime = __TIME__;

View file

@ -16,7 +16,7 @@
*/
#define FC_VERSION_MAJOR 2 // increment when a major release is made (big new feature, etc)
#define FC_VERSION_MINOR 0 // increment when a minor release is made (small new feature, change etc)
#define FC_VERSION_MINOR 1 // increment when a minor release is made (small new feature, change etc)
#define FC_VERSION_PATCH_LEVEL 0 // increment when a bug is fixed
#define STR_HELPER(x) #x
@ -26,6 +26,7 @@
#define MW_VERSION 231
extern const char* const compilerVersion;
extern const char* const targetName;
#define GIT_SHORT_REVISION_LENGTH 8 // lower case hexadecimal digits.

View file

@ -139,7 +139,7 @@ static bool ak8963Read(magDev_t * mag)
}
mag->magADCRaw[X] = -parseMag(buf + 0, magGain[X]);
mag->magADCRaw[Y] = -parseMag(buf + 2, magGain[Y]);
mag->magADCRaw[Y] = parseMag(buf + 2, magGain[Y]);
mag->magADCRaw[Z] = -parseMag(buf + 4, magGain[Z]);
return true;

View file

@ -118,7 +118,7 @@ static bool ak8975Read(magDev_t * mag)
}
mag->magADCRaw[X] = -(int16_t)(buf[1] << 8 | buf[0]) * 4;
mag->magADCRaw[Y] = -(int16_t)(buf[3] << 8 | buf[2]) * 4;
mag->magADCRaw[Y] = (int16_t)(buf[3] << 8 | buf[2]) * 4;
mag->magADCRaw[Z] = -(int16_t)(buf[5] << 8 | buf[4]) * 4;
ack = busWrite(mag->busDev, AK8975_MAG_REG_CNTL, 0x01); // start reading again

View file

@ -269,7 +269,7 @@ static bool mpu9250CompassRead(magDev_t * mag)
}
mag->magADCRaw[X] = -parseMag(buf + 0, magGain[X]);
mag->magADCRaw[Y] = -parseMag(buf + 2, magGain[Y]);
mag->magADCRaw[Y] = parseMag(buf + 2, magGain[Y]);
mag->magADCRaw[Z] = -parseMag(buf + 4, magGain[Z]);
memcpy(cachedMagData, &mag->magADCRaw, sizeof(cachedMagData));

View file

@ -2547,6 +2547,9 @@ static void cliVersion(char *cmdline)
buildTime,
shortGitRevision
);
cliPrintLinef("# GCC-%s",
compilerVersion
);
}
static void cliMemory(char *cmdline)

View file

@ -99,9 +99,12 @@ bool isRangeActive(uint8_t auxChannelIndex, const channelRange_t *range)
return false;
}
uint16_t channelValue = constrain(rcData[auxChannelIndex + NON_AUX_CHANNEL_COUNT], CHANNEL_RANGE_MIN, CHANNEL_RANGE_MAX - 1);
return (channelValue >= 900 + (range->startStep * 25) &&
channelValue < 900 + (range->endStep * 25));
// No need to constrain() here, since we're testing for a closed range defined
// by the channelRange_t. If channelValue has an invalid value, the test will
// be false anyway.
uint16_t channelValue = rcData[auxChannelIndex + NON_AUX_CHANNEL_COUNT];
return (channelValue >= CHANNEL_RANGE_MIN + (range->startStep * CHANNEL_RANGE_STEP_WIDTH) &&
channelValue < CHANNEL_RANGE_MIN + (range->endStep * CHANNEL_RANGE_STEP_WIDTH));
}
void updateActivatedModes(void)

View file

@ -72,11 +72,13 @@ typedef struct boxBitmask_s { BITARRAY_DECLARE(bits, CHECKBOX_ITEM_COUNT); } box
#define CHANNEL_RANGE_MIN 900
#define CHANNEL_RANGE_MAX 2100
#define MODE_STEP_TO_CHANNEL_VALUE(step) (CHANNEL_RANGE_MIN + 25 * step)
#define CHANNEL_VALUE_TO_STEP(channelValue) ((constrain(channelValue, CHANNEL_RANGE_MIN, CHANNEL_RANGE_MAX) - CHANNEL_RANGE_MIN) / 25)
#define CHANNEL_RANGE_STEP_WIDTH 25
#define MODE_STEP_TO_CHANNEL_VALUE(step) (CHANNEL_RANGE_MIN + CHANNEL_RANGE_STEP_WIDTH * step)
#define CHANNEL_VALUE_TO_STEP(channelValue) ((constrain(channelValue, CHANNEL_RANGE_MIN, CHANNEL_RANGE_MAX) - CHANNEL_RANGE_MIN) / CHANNEL_RANGE_STEP_WIDTH)
#define MIN_MODE_RANGE_STEP 0
#define MAX_MODE_RANGE_STEP ((CHANNEL_RANGE_MAX - CHANNEL_RANGE_MIN) / 25)
#define MAX_MODE_RANGE_STEP ((CHANNEL_RANGE_MAX - CHANNEL_RANGE_MIN) / CHANNEL_RANGE_STEP_WIDTH)
#define IS_RANGE_USABLE(range) ((range)->startStep < (range)->endStep)

View file

@ -1705,7 +1705,7 @@ groups:
- name: PG_VTX_SETTINGS_CONFIG
type: vtxSettingsConfig_t
headers: ["drivers/vtx_common.h", "io/vtx.h"]
condition: defined(VTX_COMMON) || (defined(USE_CMS) && defined(USE_VTX_SMARTAUDIO))
condition: USE_VTX_COMMON
members:
- name: vtx_band
field: band

View file

@ -154,6 +154,7 @@ void failsafeReset(void)
failsafeState.receivingRxDataPeriodPreset = 0;
failsafeState.phase = FAILSAFE_IDLE;
failsafeState.rxLinkState = FAILSAFE_RXLINK_DOWN;
failsafeState.bypassNavigation = true;
failsafeState.lastGoodRcCommand[ROLL] = 0;
failsafeState.lastGoodRcCommand[PITCH] = 0;
@ -171,7 +172,7 @@ void failsafeInit(void)
#ifdef USE_NAV
bool failsafeBypassNavigation(void)
{
return failsafeState.active && failsafeState.controlling && failsafeProcedureLogic[failsafeConfig()->failsafe_procedure].bypassNavigation;
return failsafeState.active && failsafeState.controlling && failsafeState.bypassNavigation;
}
bool failsafeMayRequireNavigationMode(void)
@ -227,6 +228,7 @@ static void failsafeActivate(failsafePhase_e newPhase)
failsafeState.active = true;
failsafeState.controlling = true;
failsafeState.phase = newPhase;
failsafeState.bypassNavigation = failsafeProcedureLogic[failsafeConfig()->failsafe_procedure].bypassNavigation;
ENABLE_FLIGHT_MODE(FAILSAFE_MODE);
failsafeState.landingShouldBeFinishedAt = millis() + failsafeConfig()->failsafe_off_delay * MILLIS_PER_TENTH_SECOND;
@ -469,6 +471,7 @@ void failsafeUpdateState(void)
// This shouldn't happen. If RTH was somehow aborted during failsafe - fallback to FAILSAFE_LANDING procedure
abortForcedRTH();
failsafeActivate(FAILSAFE_LANDING);
failsafeState.bypassNavigation = true; // Force bypassing navigation
reprocessState = true;
break;
}

View file

@ -134,6 +134,7 @@ typedef struct failsafeState_s {
bool suspended; // Failsafe is temporary suspended. This happens when we temporary suspend RX system due to EEPROM write/read
bool active; // Failsafe is active (on RC link loss)
bool controlling; // Failsafe is driving the sticks instead of pilot
bool bypassNavigation;
timeMs_t rxDataFailurePeriod;
timeMs_t rxDataRecoveryPeriod;
timeMs_t validRxDataReceivedAt;

View file

@ -240,8 +240,8 @@ void servoMixer(float dT)
input[INPUT_FEATURE_FLAPS] = FLIGHT_MODE(FLAPERON) ? servoConfig()->flaperon_throw_offset : 0;
if (IS_RC_MODE_ACTIVE(BOXCAMSTAB)) {
input[INPUT_GIMBAL_PITCH] = scaleRange(attitude.values.pitch, -1800, 1800, -360, +360);
input[INPUT_GIMBAL_ROLL] = scaleRange(attitude.values.roll, -1800, 1800, -360, +360);
input[INPUT_GIMBAL_PITCH] = scaleRange(attitude.values.pitch, -1800, 1800, -1000, +1000);
input[INPUT_GIMBAL_ROLL] = scaleRange(attitude.values.roll, -1800, 1800, -1000, +1000);
} else {
input[INPUT_GIMBAL_PITCH] = 0;
input[INPUT_GIMBAL_ROLL] = 0;

View file

@ -22,7 +22,7 @@
#define MAX_SUPPORTED_SERVOS 8
// These must be consecutive, see 'reversedSources'
enum {
typedef enum {
INPUT_STABILIZED_ROLL = 0,
INPUT_STABILIZED_PITCH = 1,
INPUT_STABILIZED_YAW = 2,

View file

@ -1472,39 +1472,31 @@ static bool osdDrawSingleElement(uint8_t item)
{
char *p = "ACRO";
if (isAirmodeActive()) {
p = "AIR ";
}
if (FLIGHT_MODE(FAILSAFE_MODE)) {
if (FLIGHT_MODE(FAILSAFE_MODE))
p = "!FS!";
} else if (FLIGHT_MODE(MANUAL_MODE)) {
else if (FLIGHT_MODE(MANUAL_MODE))
p = "MANU";
} else if (FLIGHT_MODE(NAV_RTH_MODE)) {
else if (FLIGHT_MODE(NAV_RTH_MODE))
p = "RTH ";
} else if (FLIGHT_MODE(NAV_POSHOLD_MODE)) {
if (FLIGHT_MODE(NAV_ALTHOLD_MODE)) {
// 3D HOLD
else if (FLIGHT_MODE(NAV_POSHOLD_MODE))
p = "HOLD";
} else {
p = " PH ";
}
} else if (FLIGHT_MODE(NAV_CRUISE_MODE) && FLIGHT_MODE(NAV_ALTHOLD_MODE)) {
else if (FLIGHT_MODE(NAV_CRUISE_MODE) && FLIGHT_MODE(NAV_ALTHOLD_MODE))
p = "3CRS";
} else if (FLIGHT_MODE(NAV_CRUISE_MODE)) {
else if (FLIGHT_MODE(NAV_CRUISE_MODE))
p = "CRS ";
} else if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && navigationRequiresAngleMode()) {
else if (FLIGHT_MODE(NAV_ALTHOLD_MODE) && navigationRequiresAngleMode()) {
// If navigationRequiresAngleMode() returns false when ALTHOLD is active,
// it means it can be combined with ANGLE, HORIZON, ACRO, etc...
// and its display is handled by OSD_MESSAGES rather than OSD_FLYMODE.
p = " AH ";
} else if (FLIGHT_MODE(NAV_WP_MODE)) {
} else if (FLIGHT_MODE(NAV_WP_MODE))
p = " WP ";
} else if (FLIGHT_MODE(ANGLE_MODE)) {
else if (FLIGHT_MODE(ANGLE_MODE))
p = "ANGL";
} else if (FLIGHT_MODE(HORIZON_MODE)) {
else if (FLIGHT_MODE(HORIZON_MODE))
p = "HOR ";
}
else if (isAirmodeActive())
p = "AIR ";
displayWrite(osdDisplayPort, elemPosX, elemPosY, p);
return true;

View file

@ -39,4 +39,4 @@ void rcdeviceUpdate(timeUs_t currentTimeUs);
bool rcdeviceIsEnabled(void);
// used for unit test
rcdeviceSwitchState_t switchStates[BOXCAMERA3 - BOXCAMERA1 + 1];
extern rcdeviceSwitchState_t switchStates[BOXCAMERA3 - BOXCAMERA1 + 1];

View file

@ -670,7 +670,7 @@ bool vtxSmartAudioInit(void)
serialPortConfig_t *portConfig = findSerialPortConfig(FUNCTION_VTX_SMARTAUDIO);
if (portConfig) {
portOptions_t portOptions = SERIAL_STOPBITS_2 | SERIAL_BIDIR_NOPULL;
portOptions_t portOptions = SERIAL_BIDIR_NOPULL;
#if defined(USE_VTX_COMMON)
portOptions = portOptions | (vtxConfig()->halfDuplex ? SERIAL_BIDIR | SERIAL_BIDIR_PP : SERIAL_UNIDIR);
#else

View file

@ -373,6 +373,12 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_TIMEOUT] = NAV_STATE_CRUISE_2D_ADJUSTING,
[NAV_FSM_EVENT_ERROR] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_ALTHOLD] = NAV_STATE_ALTHOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_POSHOLD_3D] = NAV_STATE_POSHOLD_3D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE_3D] = NAV_STATE_CRUISE_3D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_RTH] = NAV_STATE_RTH_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT] = NAV_STATE_WAYPOINT_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
}
},
@ -391,6 +397,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
}
},
[NAV_STATE_CRUISE_3D_IN_PROGRESS] = {
.persistentId = NAV_PERSISTENT_ID_CRUISE_3D_IN_PROGRESS,
.onEntry = navOnEnteringState_NAV_STATE_CRUISE_3D_IN_PROGRESS,
@ -425,6 +432,12 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
[NAV_FSM_EVENT_TIMEOUT] = NAV_STATE_CRUISE_3D_ADJUSTING,
[NAV_FSM_EVENT_ERROR] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_ALTHOLD] = NAV_STATE_ALTHOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_POSHOLD_3D] = NAV_STATE_POSHOLD_3D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE_2D] = NAV_STATE_CRUISE_2D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_RTH] = NAV_STATE_RTH_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT] = NAV_STATE_WAYPOINT_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_EMERGENCY_LANDING] = NAV_STATE_EMERGENCY_LANDING_INITIALIZE,
}
},

View file

@ -87,7 +87,7 @@ STATIC_UNIT_TESTED uint8_t payloadSize;
STATIC_UNIT_TESTED uint8_t rxTxAddrXN297[RX_TX_ADDR_LEN] = {0x41, 0xbd, 0x42, 0xd4, 0xc2}; // converted XN297 address
#define TX_ID_LEN 4
STATIC_UNIT_TESTED uint8_t txId[TX_ID_LEN];
uint32_t *rxSpiIdPtr;
static uint32_t *rxSpiIdPtr;
// radio channels for frequency hopping
#define H8_3D_RF_CHANNEL_COUNT 4

View file

@ -135,7 +135,7 @@ uint8_t receivedPowerSnapshot;
#define RX_TX_ADDR_LEN 5
// set rxTxAddr to the bind address
STATIC_UNIT_TESTED uint8_t rxTxAddr[RX_TX_ADDR_LEN] = {0x4b,0x5c,0x6d,0x7e,0x8f};
uint32_t *rxSpiIdPtr;
static uint32_t *rxSpiIdPtr;
#define RX_TX_ADDR_4 0xD2 // rxTxAddr[4] always set to this value
// radio channels for frequency hopping

View file

@ -552,7 +552,7 @@ uint8_t calculateBatteryPercentage(void)
uint32_t capacityDiffBetweenFullAndEmpty = currentBatteryProfile->capacity.value - currentBatteryProfile->capacity.critical;
return constrain(batteryRemainingCapacity * 100 / capacityDiffBetweenFullAndEmpty, 0, 100);
} else
return constrain((vbat - batteryCriticalVoltage) * 100L / (batteryFullVoltage - batteryCriticalVoltage), 0, 100);
return constrain((getBatteryVoltage() - batteryCriticalVoltage) * 100L / (batteryFullVoltage - batteryCriticalVoltage), 0, 100);
}
void batteryDisableProfileAutoswitch(void) {

View file

@ -95,8 +95,8 @@ bool compassDetect(magDev_t *dev, magSensor_e magHardwareToUse)
case MAG_QMC5883:
#ifdef USE_MAG_QMC5883
if (qmc5883Detect(dev)) {
#ifdef MAG_QMC5883L_ALIGN
dev->magAlign.onBoard = MAG_QMC5883L_ALIGN;
#ifdef MAG_QMC5883_ALIGN
dev->magAlign.onBoard = MAG_QMC5883_ALIGN;
#endif
magHardware = MAG_QMC5883;
break;

View file

@ -159,3 +159,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -69,7 +69,7 @@
#define USE_MAG
#define MAG_I2C_BUS BUS_I2C2
#define USE_MAG_MPU9250
#define MAG_MPU9250_ALIGN CW180_DEG_FLIP
#define MAG_MPU9250_ALIGN CW0_DEG
#define USE_MAG_AK8963
#define USE_MAG_AK8975
#define USE_MAG_HMC5883
@ -142,3 +142,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -68,7 +68,7 @@
#define USE_MAG_IST8308
#define USE_MAG_LIS3MDL
#define MAG_MPU9250_ALIGN CW180_DEG_FLIP
#define MAG_MPU9250_ALIGN CW0_DEG
#define USE_BARO
#define BARO_I2C_BUS BUS_I2C1

View file

@ -66,8 +66,8 @@
#define USE_MAG_IST8308
#define USE_MAG_LIS3MDL
#define MAG_AK9863_ALIGN CW180_DEG_FLIP
#define MAG_MPU9250_ALIGN CW180_DEG_FLIP
#define MAG_AK9863_ALIGN CW0_DEG
#define MAG_MPU9250_ALIGN CW0_DEG
#define AK8963_CS_PIN PC15
#define AK8963_SPI_BUS BUS_SPI3

View file

@ -143,3 +143,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -206,3 +206,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTE 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -140,3 +140,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTE 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -172,3 +172,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -180,3 +180,5 @@
#define TARGET_IO_PORTD BIT(2)
#define MAX_PWM_OUTPUT_PORTS 4
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -54,6 +54,8 @@
#define ACC_MPU9250_ALIGN CW0_DEG
#define USE_MAG
#define USE_MAG_MPU9250
#define MAG_MPU9250_ALIGN CW90_DEG
// MPU6 interrupts
#define USE_EXTI
#define GYRO_INT_EXTI PC4

View file

@ -134,3 +134,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -150,3 +150,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTE 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -144,3 +144,5 @@
#define TARGET_IO_PORTC 0xFFFF
#define TARGET_IO_PORTD 0xFFFF
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -184,3 +184,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -0,0 +1,33 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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 and Betaflight are distributed in the hope that they
* 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 this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#ifdef USE_TARGET_CONFIG
#include "fc/config.h"
#include "sensors/boardalignment.h"
void targetConfiguration(void) { }
#endif

View file

@ -0,0 +1,43 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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 and Betaflight are distributed in the hope that they
* 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 this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include <platform.h>
#include "drivers/io.h"
#include "drivers/pwm_mapping.h"
#include "drivers/timer.h"
const timerHardware_t timerHardware[] = {
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 1 | TIMER_OUTPUT_INVERTED, IOCFG_AF_PP, GPIO_AF_6, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM1
{ TIM1, IO_TAG(PB0), TIM_Channel_2, 1 | TIMER_OUTPUT_INVERTED | TIMER_OUTPUT_N_CHANNEL, IOCFG_AF_PP, GPIO_AF_6, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // PWM2
{ TIM15, IO_TAG(PB14), TIM_Channel_1, 1 | TIMER_OUTPUT_INVERTED, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM3
{ TIM15, IO_TAG(PB15), TIM_Channel_2, 1 | TIMER_OUTPUT_INVERTED, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM4
{ TIM3, IO_TAG(PA6), TIM_Channel_1, 1 | TIMER_OUTPUT_INVERTED, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM5
{ TIM3, IO_TAG(PA7), TIM_Channel_2, 1 | TIMER_OUTPUT_INVERTED, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // PWM6
{ TIM4, IO_TAG(PA13), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_10, TIM_USE_PWM }, // AUX1
{ TIM2, IO_TAG(PB3), TIM_Channel_2, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // TX2
{ TIM8, IO_TAG(PA15), TIM_Channel_1, 0, IOCFG_AF_PP, GPIO_AF_2, TIM_USE_PWM }, // ROLL
{ TIM2, IO_TAG(PA2), TIM_Channel_3, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // PITCH
{ TIM2, IO_TAG(PB11), TIM_Channel_4, 0, IOCFG_AF_PP, GPIO_AF_1, TIM_USE_PWM }, // YAW
};
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

View file

@ -0,0 +1,90 @@
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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 and Betaflight are distributed in the hope that they
* 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 this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define SBUS_PORT_OPTIONS (SERIAL_STOPBITS_2 | SERIAL_PARITY_EVEN | SERIAL_INVERTED | SERIAL_BIDIR)
#define TARGET_BOARD_IDENTIFIER "KISSFC"
#define LED0 PB1
#define BEEPER PB13
#define BEEPER_INVERTED
#define USE_ACC
#define USE_ACC_MPU6050
#define ACC_MPU6050_ALIGN CW180_DEG
#define MPU6050_I2C_BUS BUS_I2C1
#define USE_GYRO
#define USE_GYRO_MPU6050
#define GYRO_MPU6050_ALIGN CW180_DEG
#define USE_EXTI
#define MPU_INT_EXTI PB2
#define USE_MPU_DATA_READY_SIGNAL
#define ENSURE_MPU_DATA_READY_IS_LOW
#define USE_VCP
#define USE_UART1
#define USE_UART2
#define USE_UART3
//#define USE_SOFTSERIAL1
//#define USE_SOFTSERIAL2
#define SERIAL_PORT_COUNT 4
#define UART1_TX_PIN PA9
#define UART1_RX_PIN PA10
#define UART2_TX_PIN PB3
#define UART2_RX_PIN PB4
#define UART3_TX_PIN PB10 // PB10 (AF7)
#define UART3_RX_PIN PB11 // PB11 (AF7)
//#define SOFTSERIAL1_TX_PIN PA13 // AUX1
//#define SOFTSERIAL2_TX_PIN PA15 // ROLL
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C1_SCL PB6
#define I2C1_SDA PB7
#define USE_ADC
#define VBAT_SCALE_DEFAULT 160
#define ADC_INSTANCE ADC1
#define VBAT_ADC_PIN PA0
#define CURRENT_METER_ADC_PIN PA2
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
#define SERIALRX_PROVIDER SERIALRX_SBUS
#define SERIALRX_UART SERIAL_PORT_USART2
#define MAX_PWM_OUTPUT_PORTS 12
#define AVOID_UART2_FOR_PWM_PPM
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTF (BIT(4))

View file

@ -0,0 +1,9 @@
F3_TARGETS += $(TARGET)
FEATURES = VCP
TARGET_SRC = \
drivers/accgyro/accgyro_mpu.c \
drivers/accgyro/accgyro_mpu6050.c \
drivers/display_ug2864hsweg01.c \
drivers/serial_usb_vcp.c

View file

@ -113,3 +113,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -154,7 +154,6 @@
#define DEFAULT_I2C_BUS BUS_I2C1
#endif
#define USE_BARO
#define BARO_I2C_BUS DEFAULT_I2C_BUS
#define USE_BARO_BMP280
@ -214,3 +213,5 @@
#define TARGET_IO_PORTD (BIT(2))
#define MAX_PWM_OUTPUT_PORTS 6
#define PCA9685_I2C_BUS DEFAULT_I2C_BUS

View file

@ -177,3 +177,5 @@
#define TARGET_IO_PORTD (BIT(2))
#define MAX_PWM_OUTPUT_PORTS 9
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -131,3 +131,5 @@
// #define TARGET_IO_PORTF (BIT(0)|BIT(1))
// !!TODO - check the following line is correct
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(3)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -59,6 +59,9 @@
#define USE_MAG_IST8308
#define USE_MAG_MAG3110
#define USE_MAG_LIS3MDL
#define USE_MAG_AK8975
#undef USE_GPS_PROTO_I2C_NAV //Save some flash space
#define USB_CABLE_DETECTION
#define USB_DETECT_PIN PB5

View file

@ -13,6 +13,7 @@ TARGET_SRC = \
drivers/compass/compass_ist8308.c \
drivers/compass/compass_mag3110.c \
drivers/compass/compass_lis3mdl.c \
drivers/compass/compass_ak8975.c \
drivers/pitotmeter_ms4525.c \
drivers/pitotmeter_adc.c \
drivers/light_ws2811strip.c \

View file

@ -262,3 +262,5 @@
#ifdef OMNIBUSF4PRO
#define CURRENT_METER_SCALE 265
#endif
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -223,3 +223,5 @@
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define TARGET_IO_PORTE 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -121,3 +121,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -158,3 +158,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -48,7 +48,7 @@
#define USE_MAG
#define MAG_I2C_BUS BUS_I2C2
#define MAG_AK8975_ALIGN CW180_DEG_FLIP
#define MAG_AK8975_ALIGN CW0_DEG
#define USE_MAG_AK8975
#define USE_MAG_HMC5883
#define USE_MAG_QMC5883
@ -117,3 +117,5 @@
#define TARGET_IO_PORTA (BIT(1)|BIT(2)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)|BIT(8)|BIT(9)|BIT(10)|BIT(11)|BIT(12)|BIT(13)|BIT(14)|BIT(15))
#define TARGET_IO_PORTB (BIT(0)|BIT(1)|BIT(6)|BIT(10)|BIT(11)|BIT(14)|BIT(15)|BIT(3)|BIT(4)|BIT(5)|BIT(6)|BIT(7)|BIT(8)|BIT(9)|BIT(12)|BIT(13))
#define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -47,7 +47,7 @@
#define USE_MAG
#define USE_MAG_MPU9250
#define MAG_MPU9250_ALIGN CW270_DEG
#define MAG_MPU9250_ALIGN CW0_DEG
#define MAG_I2C_BUS BUS_I2C1
#define USE_MAG_HMC5883
@ -114,7 +114,7 @@
#define USE_ADC
#define ADC_CHANNEL_1_PIN PC2
#define ADC_CHANNEL_2_PIN PC1
#define ADC_CHANNEL_2_PIN PC3
#define VBAT_ADC_CHANNEL ADC_CHN_2
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_1
@ -140,3 +140,5 @@
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -54,7 +54,7 @@
#define USE_MAG
#define MAG_I2C_BUS BUS_I2C1
#define MAG_MPU9250_ALIGN CW90_DEG_FLIP
#define MAG_MPU9250_ALIGN CW270_DEG
#define USE_MAG_MPU9250
#define USE_MAG_HMC5883
#define USE_MAG_QMC5883

View file

@ -54,7 +54,7 @@
#define USE_MAG
#define MAG_I2C_BUS BUS_I2C1
#define MAG_AK8963_ALIGN CW270_DEG_FLIP
#define MAG_AK8963_ALIGN CW270_DEG
#define USE_MAG_AK8963
#define USE_MAG_HMC5883
#define USE_MAG_QMC5883

View file

@ -177,3 +177,5 @@
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
#define PCA9685_I2C_BUS BUS_I2C2

View file

@ -159,7 +159,7 @@
#if !defined(MAG3110_I2C_BUS)
#define MAG3110_I2C_BUS MAG_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_mag3110, DEVHW_MAG3110, MAG3110_I2C_BUS, 0x0E, NONE, DEVFLAGS_NONE);
BUSDEV_REGISTER_I2C(busdev_mag3110, DEVHW_MAG3110, MAG3110_I2C_BUS, 0x0C, NONE, DEVFLAGS_NONE);
#endif
#if defined(USE_MAG_LIS3MDL)
@ -175,7 +175,7 @@
#if !defined(IST8310_I2C_BUS)
#define IST8310_I2C_BUS MAG_I2C_BUS
#endif
BUSDEV_REGISTER_I2C(busdev_ist8310, DEVHW_IST8310, IST8310_I2C_BUS, 0x0C, NONE, DEVFLAGS_NONE);
BUSDEV_REGISTER_I2C(busdev_ist8310, DEVHW_IST8310, IST8310_I2C_BUS, 0x0E, NONE, DEVFLAGS_NONE);
#endif
#if defined(USE_MAG_IST8308)

View file

@ -419,9 +419,13 @@ static void sendAmperage(void)
static void sendFuelLevel(void)
{
if (telemetryConfig()->smartportFuelUnit == SMARTPORT_FUEL_UNIT_PERCENT) {
sendDataHead(ID_FUEL_LEVEL);
serialize16((uint16_t)calculateBatteryPercentage());
} else if (isAmperageConfigured()) {
sendDataHead(ID_FUEL_LEVEL);
serialize16((uint16_t)telemetryConfig()->smartportFuelUnit == SMARTPORT_FUEL_UNIT_MAH ? getMAhDrawn() : getMWhDrawn());
}
}
static void sendHeading(void)

View file

@ -63,6 +63,7 @@ static void *ctrlLineStateCbContext;
static void (*baudRateCb)(void *context, uint32_t baud);
static void *baudRateCbContext;
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
CDC_IF_Prop_TypeDef VCP_fops = {VCP_Init, VCP_DeInit, VCP_Ctrl, VCP_DataTx, VCP_DataRx };

View file

@ -34,7 +34,7 @@
#include "usbd_usr.h"
#include "usbd_desc.h"
__ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END;
extern USB_OTG_CORE_HANDLE USB_OTG_dev;
uint32_t CDC_Send_DATA(const uint8_t *ptrBuffer, uint32_t sendLength);
uint32_t CDC_Send_FreeBytes(void);