Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Add support for HD OSD (canvas mode) #54

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
targets: [ EMSRPROTO1, EMSRPROTO2, EMSRPROTO3, EMSRPROTO4, NEUTRONRCF435MINI, NEUTRONRCF435SE ]
targets: [ GREATMOUNTAINRCF435,BETAFPVF435, NEUTRONRCF435MINI, NEUTRONRCF435SE ]
steps:
- name: Code Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RELEASE ?= no
# Things that need to be maintained as the source changes
#

FORKNAME = betaflight
FORKNAME = ATbetaflight

# Working directories
ROOT := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
Expand Down
4 changes: 4 additions & 0 deletions make/source.mk
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ COMMON_SRC = \
cms/cms_menu_vtx_rtc6705.c \
cms/cms_menu_vtx_smartaudio.c \
cms/cms_menu_vtx_tramp.c \
cms/cms_menu_vtx_msp.c\
cms/cms_menu_persistent_stats.c \
drivers/display_ug2864hsweg01.c \
drivers/light_ws2811strip.c \
Expand All @@ -163,6 +164,7 @@ COMMON_SRC = \
io/displayport_frsky_osd.c \
io/displayport_max7456.c \
io/displayport_msp.c \
io/vtx_msp.c\
io/displayport_oled.c \
io/displayport_srxl.c \
io/displayport_crsf.c \
Expand Down Expand Up @@ -355,12 +357,14 @@ SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
cms/cms_menu_vtx_rtc6705.c \
cms/cms_menu_vtx_smartaudio.c \
cms/cms_menu_vtx_tramp.c \
cms/cms_menu_vtx_msp.c\
cms/cms_menu_persistent_stats.c \
io/vtx.c \
io/vtx_rtc6705.c \
io/vtx_smartaudio.c \
io/vtx_tramp.c \
io/vtx_control.c \
io/vtx_msp.c\
io/spektrum_vtx_control.c \
osd/osd.c \
osd/osd_elements.c \
Expand Down
95 changes: 61 additions & 34 deletions src/main/blackbox/blackbox.c

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/main/blackbox/blackbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ typedef enum FlightLogEvent {
} FlightLogEvent;

typedef struct blackboxConfig_s {
uint32_t fields_disabled_mask;
uint8_t sample_rate; // sample rate
uint8_t device;
uint32_t fields_disabled_mask;
uint8_t mode;
uint8_t high_resolution;
} blackboxConfig_t;

PG_DECLARE(blackboxConfig_t, blackboxConfig);
Expand Down
17 changes: 15 additions & 2 deletions src/main/build/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#pragma once

#define DEBUG16_VALUE_COUNT 4
#define DEBUG16_VALUE_COUNT 8
extern int16_t debug[DEBUG16_VALUE_COUNT];
extern uint8_t debugMode;

Expand Down Expand Up @@ -93,14 +93,27 @@ typedef enum {
DEBUG_D_LPF,
DEBUG_VTX_TRAMP,
DEBUG_GHST,
DEBUG_GHST_MSP,
DEBUG_SCHEDULER_DETERMINISM,
DEBUG_TIMING_ACCURACY,
DEBUG_RX_EXPRESSLRS_SPI,
DEBUG_RX_EXPRESSLRS_PHASELOCK,
DEBUG_RX_STATE_TIME,
DEBUG_GPS_RESCUE_VELOCITY,
DEBUG_GPS_RESCUE_HEADING,
DEBUG_GPS_RESCUE_TRACKING,
DEBUG_ATTITUDE,
DEBUG_VTX_MSP,
DEBUG_GPS_DOP,
DEBUG_FAILSAFE,
DEBUG_GYRO_CALIBRATION,
DEBUG_ANGLE_MODE,
DEBUG_ANGLE_TARGET,
DEBUG_CURRENT_ANGLE,
DEBUG_DSHOT_TELEMETRY_COUNTS,
DEBUG_SMITH_PREDICTOR,
// DEBUG_BMI270_GYRO,
DEBUG_COUNT
} debugType_e;

extern const char * const debugModeNames[DEBUG_COUNT];

2 changes: 1 addition & 1 deletion src/main/build/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define FC_FIRMWARE_IDENTIFIER "BTFL"
#define FC_VERSION_MAJOR 4 // increment when a major release is made (big new feature, etc)
#define FC_VERSION_MINOR 3 // increment when a minor release is made (small new feature, change etc)
#define FC_VERSION_PATCH_LEVEL 2 // increment when a bug is fixed
#define FC_VERSION_PATCH_LEVEL 3 // increment when a bug is fixed

#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL)

Expand Down
59 changes: 40 additions & 19 deletions src/main/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -3125,10 +3125,10 @@ static void cliSimplifiedTuning(const char *cmdName, char *cmdline)
}
#endif

static void printName(dumpFlags_t dumpMask, const pilotConfig_t *pilotConfig)
static void printCraftName(dumpFlags_t dumpMask, const pilotConfig_t *pilotConfig)
{
const bool equalsDefault = strlen(pilotConfig->name) == 0;
cliDumpPrintLinef(dumpMask, equalsDefault, "\r\n# name: %s", equalsDefault ? emptyName : pilotConfig->name);
const bool equalsDefault = strlen(pilotConfig->craftName) == 0;
cliDumpPrintLinef(dumpMask, equalsDefault, "\r\n# name: %s", equalsDefault ? emptyName : pilotConfig->craftName);
}

#if defined(USE_BOARD_INFO)
Expand Down Expand Up @@ -5104,10 +5104,10 @@ const cliResourceValue_t resourceTable[] = {
#ifdef USE_SERVOS
DEFA( OWNER_SERVO, PG_SERVO_CONFIG, servoConfig_t, dev.ioTags[0], MAX_SUPPORTED_SERVOS ),
#endif
#if defined(USE_PPM)
#if defined(USE_RX_PPM)
DEFS( OWNER_PPMINPUT, PG_PPM_CONFIG, ppmConfig_t, ioTag ),
#endif
#if defined(USE_PWM)
#if defined(USE_RX_PWM)
DEFA( OWNER_PWMINPUT, PG_PWM_CONFIG, pwmConfig_t, ioTags[0], PWM_INPUT_PORT_COUNT ),
#endif
#ifdef USE_RANGEFINDER_HCSR04
Expand Down Expand Up @@ -6156,6 +6156,8 @@ static void cliResource(const char *cmdName, char *cmdline)
#endif

#ifdef USE_DSHOT_TELEMETRY


static void cliDshotTelemetryInfo(const char *cmdName, char *cmdline)
{
UNUSED(cmdName);
Expand All @@ -6170,27 +6172,45 @@ static void cliDshotTelemetryInfo(const char *cmdName, char *cmdline)
cliPrintLinefeed();

#ifdef USE_DSHOT_TELEMETRY_STATS
cliPrintLine("Motor eRPM RPM Hz Invalid");
cliPrintLine("===== ======= ====== ===== =======");
cliPrintLine("Motor Type eRPM RPM Hz Invalid TEMP VCC CURR ST/EV DBG1 DBG2 DBG3");
cliPrintLine("===== ====== ====== ====== ====== ======= ====== ====== ====== ====== ====== ====== ======");
#else
cliPrintLine("Motor eRPM RPM Hz");
cliPrintLine("===== ======= ====== =====");
cliPrintLine("Motor Type eRPM RPM Hz TEMP VCC CURR ST/EV DBG1 DBG2 DBG3");
cliPrintLine("===== ====== ====== ====== ====== ====== ====== ====== ====== ====== ====== ======");
#endif

for (uint8_t i = 0; i < getMotorCount(); i++) {
cliPrintf("%5d %7d %6d %5d ", i,
(int)getDshotTelemetry(i) * 100,
(int)getDshotTelemetry(i) * 100 * 2 / motorConfig()->motorPoleCount,
(int)getDshotTelemetry(i) * 100 * 2 / motorConfig()->motorPoleCount / 60);
const uint16_t erpm = getDshotTelemetry(i);
const uint16_t rpm = erpmToRpm(erpm);

cliPrintf("%5d %c%c%c%c%c %6d %6d %6d",
i + 1,
((dshotTelemetryState.motorState[i].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_eRPM)) ? 'R' : '-'),
((dshotTelemetryState.motorState[i].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_TEMPERATURE)) ? 'T' : '-'),
((dshotTelemetryState.motorState[i].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_VOLTAGE)) ? 'V' : '-'),
((dshotTelemetryState.motorState[i].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_CURRENT)) ? 'C' : '-'),
((dshotTelemetryState.motorState[i].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_STATE_EVENTS)) ? 'S' : '-'),
erpm * 100, rpm, rpm / 60);

#ifdef USE_DSHOT_TELEMETRY_STATS
if (isDshotMotorTelemetryActive(i)) {
const int calcPercent = getDshotTelemetryMotorInvalidPercent(i);
cliPrintLinef("%3d.%02d%%", calcPercent / 100, calcPercent % 100);
int32_t calcPercent = getDshotTelemetryMotorInvalidPercent(i);
cliPrintf(" %3d.%02d%%", calcPercent / 100, calcPercent % 100);
} else {
cliPrintLine("NO DATA");
cliPrint(" NO DATA");
}
#else
cliPrintLinefeed();
#endif

cliPrintLinef(" %6d %3d.%02d %6d %6d %6d %6d %6d",
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_TEMPERATURE],
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_VOLTAGE] / 4,
25 * (dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_VOLTAGE] % 4),
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_CURRENT],
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_STATE_EVENTS],
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_DEBUG1],
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_DEBUG2],
dshotTelemetryState.motorState[i].telemetryData[DSHOT_TELEMETRY_TYPE_DEBUG3]
);
}
cliPrintLinefeed();

Expand All @@ -6214,6 +6234,7 @@ static void cliDshotTelemetryInfo(const char *cmdName, char *cmdline)
cliPrintLine("Dshot telemetry not enabled");
}
}

#endif

static void printConfig(const char *cmdName, char *cmdline, bool doDiff)
Expand Down Expand Up @@ -6280,7 +6301,7 @@ static void printConfig(const char *cmdName, char *cmdline, bool doDiff)
}

if (!(dumpMask & HARDWARE_ONLY)) {
printName(dumpMask, &pilotConfig_Copy);
printCraftName(dumpMask, &pilotConfig_Copy);
}

#ifdef USE_RESOURCE_MGMT
Expand Down
Loading