feat: basic H7 support (#5228)

Co-authored-by: Malte Langermann <malte@langermann.net>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Richard Li <richard.li@ces.hk>
This commit is contained in:
Raphael Coeffic
2024-07-05 19:28:44 +10:00
committed by GitHub
co-authored by Malte Langermann 3djc raphaelcoeffic Richard Li
parent 2110f1b938
commit 6f8a5313d5
517 changed files with 461229 additions and 395603 deletions
@@ -79,23 +79,23 @@ class Layout: public LayoutBase
}
bool hasTopbar() const {
return getOptionValue(LAYOUT_OPTION_TOPBAR)->boolValue;
return ((uint8_t*)(&getOptionValue(LAYOUT_OPTION_TOPBAR)->boolValue))[0];
}
bool hasFlightMode() const {
return getOptionValue(LAYOUT_OPTION_FM)->boolValue;
return ((uint8_t*)(&getOptionValue(LAYOUT_OPTION_FM)->boolValue))[0];
}
bool hasSliders() const {
return getOptionValue(LAYOUT_OPTION_SLIDERS)->boolValue;
return ((uint8_t*)(&getOptionValue(LAYOUT_OPTION_SLIDERS)->boolValue))[0];
}
bool hasTrims() const {
return getOptionValue(LAYOUT_OPTION_TRIMS)->boolValue;
return ((uint8_t*)(&getOptionValue(LAYOUT_OPTION_TRIMS)->boolValue))[0];
}
bool isMirrored() const {
return getOptionValue(LAYOUT_OPTION_MIRRORED)->boolValue;
return ((uint8_t*)(&getOptionValue(LAYOUT_OPTION_MIRRORED)->boolValue))[0];
}
// Set decoration visibility
+18 -20
View File
@@ -69,7 +69,7 @@ static lv_disp_drv_t* refr_disp = nullptr;
static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
lv_color_t* color_p)
{
#if (!defined(LCD_VERTICAL_INVERT) || defined(RADIO_F16)) && !defined(BOOT)
#if (!defined(LCD_VERTICAL_INVERT) || defined(RADIO_F16)) && !defined(BOOT)
#if defined(RADIO_F16)
if (hardwareOptions.pcbrev > 0)
#endif
@@ -102,31 +102,29 @@ static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
#if (!defined(LCD_VERTICAL_INVERT) || defined(RADIO_F16)) && !defined(BOOT)
#if defined(RADIO_F16)
if (hardwareOptions.pcbrev > 0)
if (hardwareOptions.pcbrev > 0)
#endif
{
uint16_t* src = (uint16_t*)color_p;
uint16_t* dst = nullptr;
if ((uint16_t*)color_p == LCD_FIRST_FRAME_BUFFER)
dst = LCD_SECOND_FRAME_BUFFER;
else
dst = LCD_FIRST_FRAME_BUFFER;
{
uint16_t* src = (uint16_t*)color_p;
uint16_t* dst = nullptr;
if ((uint16_t*)color_p == LCD_FIRST_FRAME_BUFFER)
dst = LCD_SECOND_FRAME_BUFFER;
else
dst = LCD_FIRST_FRAME_BUFFER;
lv_disp_t* disp = _lv_refr_get_disp_refreshing();
for (int i = 0; i < disp->inv_p; i++) {
if (disp->inv_area_joined[i]) continue;
lv_disp_t* disp = _lv_refr_get_disp_refreshing();
for (int i = 0; i < disp->inv_p; i++) {
if (disp->inv_area_joined[i]) continue;
const lv_area_t& refr_area = disp->inv_areas[i];
const lv_area_t& refr_area = disp->inv_areas[i];
auto area_w = refr_area.x2 - refr_area.x1 + 1;
auto area_h = refr_area.y2 - refr_area.y1 + 1;
auto area_w = refr_area.x2 - refr_area.x1 + 1;
auto area_h = refr_area.y2 - refr_area.y1 + 1;
DMACopyBitmap(dst, LCD_W, LCD_H, refr_area.x1, refr_area.y1, src, LCD_W,
LCD_H, refr_area.x1, refr_area.y1, area_w, area_h);
DMACopyBitmap(dst, LCD_W, LCD_H, refr_area.x1, refr_area.y1, src, LCD_W,
LCD_H, refr_area.x1, refr_area.y1, area_w, area_h);
}
}
DMAWait(); // wait for the last DMACopyBitmap to be completed before
// sending completion message
}
#endif
}
@@ -266,6 +266,7 @@ void RadioSdManagerPage::fileAction(const char* path, const char* name,
audioQueue.playFile(fullpath, 0, ID_PLAY_FROM_SD_MANAGER);
});
}
#if defined(HARDWARE_INTERNAL_MODULE) || defined(HARDWARE_EXTERNAL_MODULE)
#if defined(MULTIMODULE) && !defined(DISABLE_MULTI_UPDATE)
if (!strcasecmp(ext, MULTI_FIRMWARE_EXT)) {
MultiFirmwareInformation information;
@@ -409,6 +410,7 @@ void RadioSdManagerPage::fileAction(const char* path, const char* name,
#endif // _NYI_
}
}
#endif
#if defined(LUA)
else if (isExtensionMatching(ext, SCRIPTS_EXT)) {
menu->addLine(STR_EXECUTE_FILE, [=]() {
+4
View File
@@ -186,6 +186,7 @@ class DateTimeWindow : public Window
}
};
#if defined(AUDIO)
static SetupLineDef soundPageSetupLines[] = {
{
// Beeps mode
@@ -252,6 +253,7 @@ static SetupLineDef soundPageSetupLines[] = {
}
},
};
#endif
#if defined(VARIO)
static SetupLineDef varioPageSetupLines[] = {
@@ -926,7 +928,9 @@ void RadioSetupPage::build(Window* window)
// Sub-pages
w = new SetupButtonGroup(window, {0, y, LCD_W - padding * 2, 0}, nullptr, BTN_COLS, PAD_TINY, {
#if defined(AUDIO)
{STR_SOUND_LABEL, []() { new SubPage(ICON_RADIO_SETUP, STR_RADIO_SETUP, STR_SOUND_LABEL, soundPageSetupLines, DIM(soundPageSetupLines)); }},
#endif
#if defined(VARIO)
{STR_VARIO, []() { new SubPage(ICON_RADIO_SETUP, STR_RADIO_SETUP, STR_VARIO, varioPageSetupLines, DIM(varioPageSetupLines)); }},
#endif
@@ -245,7 +245,9 @@ class DateTimeWidget : public TopBarWidget
void update() override
{
// get color from options
dateTime->setColor(persistentData->options[0].value.unsignedValue);
uint32_t color;
memcpy(&color, &persistentData->options[0].value.unsignedValue, sizeof(color));
dateTime->setColor(color);
}
HeaderDateTime* dateTime = nullptr;
@@ -164,5 +164,5 @@ class WidgetsContainerImpl : public WidgetsContainer
protected:
PersistentData* persistentData;
Widget* widgets[N] = {};
Widget* widgets[N] = {nullptr};
};