Files
edgetx-gx12/radio/src/datastructs.h
T
c8693569b0 feat(color): New label based Model Selector (#1374)
* Model Labels Selector

* Portrait Layout

* Receiver ID Check

* Fix Labels .yml format

* Companion Initial Commit

commit 967ddf3979b4954402fe62c858faba4b7a416bba
Author: dlktdr <cblackburn320@gmail.com>
Date:   Mon Aug 29 01:49:15 2022 -0700

    Fix Labels .yml format

commit 534221cad9e01146c47a9ac1080a655e04f1f6c8
Author: dlktdr <cblackburn320@gmail.com>
Date:   Mon Aug 29 01:20:57 2022 -0700

    Receiver ID Check

commit f32c0939d44e9ae60bc0705a9176354c23fec198
Author: dlktdr <cblackburn320@gmail.com>
Date:   Sun Aug 28 23:13:25 2022 -0700

    Portrait Layout

commit 961181217c7841ff3f21299ac6aa419b810f80e9
Author: dlktdr <cblackburn320@gmail.com>
Date:   Sat Dec 11 16:56:13 2021 -0800

    Model Labels Selector

commit dc99dd40d2
Author: David PHAM-VAN <1387855+DavBfr@users.noreply.github.com>
Date:   Fri Aug 26 03:04:34 2022 -0300

    feat: Allow Lua widget to override built-in widget with same name (#2208)

    * Allow CPP Widgets Override with LUA

    * Reset a widget option it the type differs

commit 4b747caff9
Author: eshifri <46511024+eshifri@users.noreply.github.com>
Date:   Thu Aug 25 19:47:53 2022 -0700

    fix: Write model name into models.yml when duplicating model (#2224)

    * Update model name in the models.yml file (#2214)

    * Fix the length of the name.

commit e97f23a305
Author: eshifri <46511024+eshifri@users.noreply.github.com>
Date:   Wed Aug 24 21:19:52 2022 -0700

    fix(cpn): Fix full path to model notes for Simulator (#2223)

* Correct Highlighted Column

* labels .yml indentation

* Update da.h

New defines translated to Danish

* Update dataconstants.h

Omit warnings due to difference of LEN_MODEL_FILENAME and LEN_MODEL_NAME in modellist.cpp

* Update modelslist.cpp

Wonder if this are the right file in PR #1374 (?), seems a lot are changed to the better in #1374

* Update dataconstants.h

Restore #define for LEN_MODEL_FILENAME to 16

* Rebase, Correct Issues

Delete now deletes instead of select
New model stores correct information
Duplicate save all information in cell
Rework items to use cell over button
Reword function variables

* CMPN: Add context menu

Fix output not functional. Removed Yaml::null at some point :)
Fix some compiler warnings

* CMPN: Compiler warning, replace ,->_ in list

* FW: Various Changes

Change view to a grid
Don't allow comma in label name
Add scroll indicators
Save sort order

Co-authored-by: HThuren <99370924+HThuren@users.noreply.github.com>
2022-09-03 09:01:19 +10:00

154 lines
4.1 KiB
C

/*
* 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.
*/
#pragma once
#if !defined(BOOT)
#include "datastructs_private.h"
#if !defined(BACKUP)
/* Compile time check to test structure size has not changed *
Changing the size of one of the eeprom structs may cause wrong data to
be loaded. Error out if the struct size changes.
This function tries not avoid checking or using the defines
other than the CPU arch and board type so changes in other
defines also trigger the struct size changes */
#include "chksize.h"
#define CHKSIZE(x, y) check_size<struct x, y>()
#define CHKTYPE(x, y) check_size<x, y>()
static inline void check_struct()
{
CHKSIZE(CurveRef, 2);
/* Difference between Taranis/Horus is LEN_EXPOMIX_NAME */
/* LEN_xFUNCTION_NAME is the difference in CustomFunctionData */
CHKSIZE(VarioData, 5);
#if defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE)
CHKSIZE(MixData, 20);
CHKSIZE(ExpoData, 17);
CHKSIZE(LimitData, 11);
CHKSIZE(LogicalSwitchData, 9);
CHKSIZE(CustomFunctionData, 11);
CHKSIZE(FlightModeData, 28 + 2*NUM_TRIMS);
CHKSIZE(TimerData, 12);
CHKSIZE(SwashRingData, 8);
CHKSIZE(FrSkyBarData, 6);
CHKSIZE(FrSkyLineData, 4);
CHKTYPE(TelemetryScreenData, 24);
CHKSIZE(ModelHeader, 12);
CHKSIZE(CurveHeader, 4);
#elif defined(PCBTARANIS)
CHKSIZE(MixData, 20);
CHKSIZE(ExpoData, 17);
CHKSIZE(LimitData, 13);
CHKSIZE(LogicalSwitchData, 9);
CHKSIZE(CustomFunctionData, 11);
CHKSIZE(FlightModeData, 40);
CHKSIZE(TimerData, 17);
CHKSIZE(SwashRingData, 8);
CHKSIZE(FrSkyBarData, 6);
CHKSIZE(FrSkyLineData, 6);
CHKTYPE(TelemetryScreenData, 24);
CHKSIZE(ModelHeader, 24);
CHKSIZE(CurveHeader, 4);
#elif defined(PCBHORUS)
CHKSIZE(MixData, 20);
CHKSIZE(ExpoData, 17);
CHKSIZE(LimitData, 13);
CHKSIZE(CustomFunctionData, 9);
CHKSIZE(FlightModeData, 44);
CHKSIZE(TimerData, 17);
CHKSIZE(SwashRingData, 8);
CHKSIZE(ModelHeader, 131);
CHKSIZE(CurveHeader, 4);
CHKSIZE(CustomScreenData, 850);
CHKTYPE(TopBarPersistentData, 300);
#elif defined(PCBNV14)
// TODO
#else
// Common for all variants
CHKSIZE(LimitData, 5);
CHKSIZE(SwashRingData, 3);
CHKSIZE(FrSkyBarData, 3);
CHKSIZE(FrSkyLineData, 2);
CHKSIZE(ModelHeader, 11);
CHKTYPE(CurveHeader, 1);
CHKSIZE(MixData, 9);
CHKSIZE(ExpoData, 4);
CHKSIZE(CustomFunctionData, 3);
CHKSIZE(TimerData, 3);
CHKSIZE(FlightModeData, 30);
CHKSIZE(RadioData, 86);
#endif /* board specific ifdefs*/
CHKSIZE(LogicalSwitchData, 9);
CHKSIZE(TelemetrySensor, 14);
CHKSIZE(ModuleData, 29);
CHKSIZE(GVarData, 7);
CHKSIZE(RssiAlarmData, 2);
CHKSIZE(TrainerData, 16);
#if defined(PCBXLITES)
CHKSIZE(RadioData, 862);
CHKSIZE(ModelData, 6164);
#elif defined(PCBXLITE)
CHKSIZE(RadioData, 860);
CHKSIZE(ModelData, 6164);
#elif defined(RADIO_TPRO)
CHKSIZE(RadioData, 843);
CHKSIZE(ModelData, 6189);
#elif defined(PCBX7)
CHKSIZE(RadioData, 866);
CHKSIZE(ModelData, 6164);
#elif defined(PCBX9E)
CHKSIZE(RadioData, 956);
CHKSIZE(ModelData, 6616);
#elif defined(PCBX9D) || defined(PCBX9DP)
CHKSIZE(RadioData, 898);
CHKSIZE(ModelData, 6608);
#elif defined(PCBHORUS)
#if defined(PCBX10)
CHKSIZE(RadioData, 924);
CHKSIZE(ModelData, 11128);
#else
CHKSIZE(RadioData, 906);
CHKSIZE(ModelData, 11126);
#endif
#elif defined(PCBNV14)
CHKSIZE(RadioData, 852);
CHKSIZE(ModelData, 10942);
#endif
#undef CHKSIZE
}
#endif /* BACKUP */
#endif /* !BOOT */