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

feat: support for HelloRadioSky V16 #5317

Merged
merged 25 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0ab02ef
Initial support of HelloRadioSky V16
richardclli Mar 14, 2024
4cc5fab
Hardware mapping: ADC, POTS, INTMODULE_BOOT, AUX1
richardclli Mar 16, 2024
2bb0707
Hardware mapping: int/ext module (PPM/HB->UART3, S.PORT-> UART2, INTM…
richardclli Mar 16, 2024
5f5b5e6
LED Strip 6 + 16 + 16 configuration
richardclli Mar 20, 2024
e613302
W2812 driver add auto detection of 16/32 bit counter
richardclli Mar 26, 2024
c880e93
First 6 LEDs belongs to 6 POS keys, opt out from being controlled by …
richardclli Mar 26, 2024
038c8b4
Added 6-pos switch and LED strip control.
richardclli May 20, 2024
0bd6b04
Fixed boot cmd pin configuration
richardclli May 24, 2024
95ef20b
Clean up some definitions
richardclli May 28, 2024
27d4b7a
Fixed heartbeat definition
richardclli Jul 5, 2024
751d28c
Added CSD203 voltage/current sensor
richardclli Jul 17, 2024
b86803f
Fixed some problems after rebase
richardclli Jul 19, 2024
23e42c8
chore: alphabetical order, fix changed name
pfeerick Jul 22, 2024
5d067b9
chore: formatting, consistency
pfeerick Jul 28, 2024
769d7fd
chore: De Morgans's law, more maintainable form
pfeerick Jul 28, 2024
e855cac
chore: really in alpha order
pfeerick Jul 28, 2024
4f64af1
chore: core cpn support
pfeerick Jul 28, 2024
59b375f
fix(radio): will primarily be ELRS internal RF
pfeerick Aug 1, 2024
fa7af10
fix: #5428 introduced LED type specifier
pfeerick Aug 14, 2024
5625bb9
fix: header name change from #5396
pfeerick Aug 19, 2024
e606adf
chore: cleanup CSD203 formatting, naming
pfeerick Aug 29, 2024
ddeff90
fix: stop simulator crashing due to missing funcitons
pfeerick Aug 29, 2024
d69472b
chore: minimal functional simulator
pfeerick Aug 29, 2024
37b4a2e
fix: missing POT1 for X10 radios
pfeerick Aug 31, 2024
1e701e4
chore: just include the headers...
pfeerick Aug 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ body:
- FrSky X10 Express / X10S Express (ACCESS)
- FrSky X12
- FrSky X-Lite / S / Pro
- HelloRadioSky V16
- Jumper T12
- Jumper T14
- Jumper T16
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
- tx12;tx12mk2;boxer
- tx16s
- f16
- v16
- x10;x10express
- x12s
- x7;x7access
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- tx12;tx12mk2;boxer
- tx16s
- f16
- v16
- x10;x10express
- x12s
- x7;x7access
Expand Down
2 changes: 2 additions & 0 deletions companion/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
set(FLAVOUR tx16s)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL F16)
set(FLAVOUR f16)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL V16)
set(FLAVOUR v16)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T14)
set(FLAVOUR t14)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T15)
Expand Down
9 changes: 9 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@
<file>images/simulator/Pocket/right.png</file>
<file>images/simulator/Pocket/top.png</file>
<file>images/simulator/Pocket/bottom.png</file>
<file>images/simulator/V16/left.png</file>
<file>images/simulator/V16/left_pagedn.png</file>
<file>images/simulator/V16/left_pageup.png</file>
<file>images/simulator/V16/left_rtn.png</file>
<file>images/simulator/V16/left_sys.png</file>
<file>images/simulator/V16/left_tele.png</file>
<file>images/simulator/V16/right.png</file>
<file>images/simulator/V16/right_ent.png</file>
<file>images/simulator/V16/right_mdl.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
Expand Down
5 changes: 5 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return 0;
default:
return 0;
Expand Down Expand Up @@ -267,6 +268,7 @@ int Boards::getFlashSize(Type board)
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PL18:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
Expand Down Expand Up @@ -581,6 +583,8 @@ QString Boards::getBoardName(Board::Type board)
return "iFlight Commando 8";
case BOARD_FATFISH_F16:
return "Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "HelloRadioSky V16";
default:
return CPN_STR_UNKNOWN_ITEM;
}
Expand Down Expand Up @@ -694,6 +698,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_TPROS:
case BOARD_FATFISH_F16:
case BOARD_HELLORADIOSKY_V16:
return (int)MODULE_TYPE_CROSSFIRE;

case BOARD_FLYSKY_NV14:
Expand Down
8 changes: 7 additions & 1 deletion companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace Board {
BOARD_RADIOMASTER_POCKET,
BOARD_JUMPER_T20V2,
BOARD_FATFISH_F16,
BOARD_HELLORADIOSKY_V16,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
Expand Down Expand Up @@ -514,9 +515,14 @@ inline bool IS_FATFISH_F16(Board::Type board)
return board == Board::BOARD_FATFISH_F16;
}

inline bool IS_HELLORADIOSKY_V16(Board::Type board)
{
return board == Board::BOARD_HELLORADIOSKY_V16;
}

inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16;
return board == Board::BOARD_JUMPER_T15 || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16;
}

inline bool IS_FAMILY_T12(Board::Type board)
Expand Down
9 changes: 9 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for iFlight Commando 8";
case BOARD_FATFISH_F16:
return "EdgeTX for Fatfish F16";
case BOARD_HELLORADIOSKY_V16:
return "EdgeTX for HelloRadioSky V16";
default:
return "Board is unknown to EdgeTX";
}
Expand Down Expand Up @@ -1390,6 +1392,13 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, EU + FLEX);

/* HelloRadioSky V16 board */
firmware = new OpenTxFirmware(FIRMWAREID("v16"), Firmware::tr("HelloRadioSky V16"), BOARD_HELLORADIOSKY_V16);
addOpenTxFrskyOptions(firmware);
addOpenTxRfOptions(firmware, FLEX);
firmware->addOptionsGroup({opt_bt, opt_internal_gps});
registerOpenTxFirmware(firmware);

/* iFlight Commando8 board */
firmware = new OpenTxFirmware(FIRMWAREID("commando8"), QCoreApplication::translate("Firmware", "iFlight Commando8"), BOARD_IFLIGHT_COMMANDO8);
addOpenTxCommonOptions(firmware);
Expand Down
Binary file added companion/src/images/simulator/V16/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/left_rtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/left_sys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/left_tele.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/right_ent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added companion/src/images/simulator/V16/right_mdl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions companion/src/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetT8.cpp
simulateduiwidgetTX12.cpp
simulateduiwidgetTX16S.cpp
simulateduiwidgetV16.cpp
simulateduiwidgetX10.cpp
simulateduiwidgetX12.cpp
simulateduiwidgetX7.cpp
Expand Down
13 changes: 13 additions & 0 deletions companion/src/simulation/simulateduiwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ namespace Ui {
class SimulatedUIWidgetNV14;
class SimulatedUIWidgetEL18;
class SimulatedUIWidgetPL18;
class SimulatedUIWidgetV16;
}

class SimulatedUIWidget9X: public SimulatedUIWidget
Expand Down Expand Up @@ -540,4 +541,16 @@ class SimulatedUIWidgetPL18: public SimulatedUIWidget
Ui::SimulatedUIWidgetPL18 * ui;
};

class SimulatedUIWidgetV16: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidgetV16(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetV16();

private:
Ui::SimulatedUIWidgetV16 * ui;
};

#endif // SIMULATEDUIWIDGET_H
69 changes: 69 additions & 0 deletions companion/src/simulation/simulateduiwidgetV16.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/

#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetV16.h"

SimulatedUIWidgetV16::SimulatedUIWidgetV16(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetV16)
{
RadioUiAction * act;

ui->setupUi(this);

// add actions in order of appearance on the help menu

act = new RadioUiAction(KEY_SYS, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->left->addArea(QRect(60, 10, 81, 51), "V16/left_sys.png", act));

act = new RadioUiAction(KEY_EXIT, QList<int>() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace,
SIMU_STR_HLP_KEY_DN % "<br>" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN);
addRadioWidget(ui->left->addArea(QRect(75, 105, 60, 30), "V16/left_rtn.png", act));

act = new RadioUiAction(KEY_PAGEDN, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
addRadioWidget(ui->left->addArea(QRect(75, 160, 60, 30), "V16/left_pagedn.png", act));

act = new RadioUiAction(KEY_PAGEUP, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
addRadioWidget(ui->left->addArea(QRect(75, 220, 60, 30), "V16/left_pageup.png", act));

act = new RadioUiAction(KEY_TELE, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
addRadioWidget(ui->left->addArea(QRect(75, 280, 80, 35), "V16/left_tele.png", act));

m_mouseMidClickAction = new RadioUiAction(KEY_ENTER, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
addRadioWidget(ui->right->addArea(QRect(40, 130, 51, 131), "V16/right_ent.png", m_mouseMidClickAction));

act = new RadioUiAction(KEY_MODEL, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
addRadioWidget(ui->right->addArea(QRect(30, 10, 81, 51), "V16/right_mdl.png", act));

m_scrollUpAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT);
m_scrollDnAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT);
connectScrollActions();

m_backlightColors << QColor(47, 123, 227);

setLcd(ui->lcd);
}

SimulatedUIWidgetV16::~SimulatedUIWidgetV16()
{
delete ui;
}
151 changes: 151 additions & 0 deletions companion/src/simulation/simulateduiwidgetV16.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetV16</class>
<widget class="QWidget" name="SimulatedUIWidgetV16">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>829</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>829</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>829</width>
<height>355</height>
</size>
</property>
<widget class="ButtonsWidget" name="right" native="true">
<property name="geometry">
<rect>
<x>658</x>
<y>0</y>
<width>167</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>167</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>167</width>
<height>320</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/V16/right.png)</string>
</property>
</widget>
<widget class="ButtonsWidget" name="left" native="true">
<property name="geometry">
<rect>
<x>1</x>
<y>0</y>
<width>175</width>
<height>320</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>175</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>175</width>
<height>320</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/V16/left.png);</string>
</property>
</widget>
<widget class="LcdWidget" name="lcd" native="true">
<property name="geometry">
<rect>
<x>177</x>
<y>24</y>
<width>480</width>
<height>272</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>272</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</width>
<height>272</height>
</size>
</property>
<property name="font">
<font>
<pointsize>5</pointsize>
</font>
</property>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>LcdWidget</class>
<extends>QWidget</extends>
<header>lcdwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonsWidget</class>
<extends>QWidget</extends>
<header>buttonswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../companion.qrc"/>
</resources>
<connections/>
</ui>
3 changes: 3 additions & 0 deletions companion/src/simulation/simulatorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_FLYSKY_PL18:
radioUiWidget = new SimulatedUIWidgetPL18(simulator, this);
break;
case Board::BOARD_HELLORADIOSKY_V16:
radioUiWidget = new SimulatedUIWidgetV16(simulator, this);
break;
default:
radioUiWidget = new SimulatedUIWidget9X(simulator, this);
break;
Expand Down
Loading
Loading