1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

Will raise a warning next time we forget a FourCC or an EEPROM size

This commit is contained in:
Bertrand Songis 2019-05-18 08:57:06 +02:00
parent 0714163470
commit 3e7fe16ee1
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
2 changed files with 15 additions and 6 deletions

View file

@ -47,7 +47,7 @@ using namespace Board;
void Boards::setBoardType(const Type & board) void Boards::setBoardType(const Type & board)
{ {
if (board >= BOARD_UNKNOWN && board < BOARD_ENUM_COUNT) if (board >= BOARD_UNKNOWN && board <= BOARD_TYPE_MAX)
m_boardType = board; m_boardType = board;
else else
m_boardType = BOARD_UNKNOWN; m_boardType = BOARD_UNKNOWN;
@ -80,9 +80,14 @@ uint32_t Boards::getFourCC(Type board)
case BOARD_MEGA2560: case BOARD_MEGA2560:
case BOARD_GRUVIN9X: case BOARD_GRUVIN9X:
return 0x3178746F; return 0x3178746F;
default: case BOARD_STOCK:
case BOARD_M128:
return 0; return 0;
case BOARD_UNKNOWN:
break;
} }
return 0;
} }
const int Boards::getEEpromSize(Board::Type board) const int Boards::getEEpromSize(Board::Type board)
@ -110,9 +115,12 @@ const int Boards::getEEpromSize(Board::Type board)
return EESIZE_TARANIS; return EESIZE_TARANIS;
case BOARD_UNKNOWN: case BOARD_UNKNOWN:
return EESIZE_MAX; return EESIZE_MAX;
default: case BOARD_X12S:
return 0; // unlimited case BOARD_X10:
return 0;
} }
return 0;
} }
const int Boards::getFlashSize(Type board) const int Boards::getFlashSize(Type board)

View file

@ -47,10 +47,11 @@ namespace Board {
BOARD_X10, BOARD_X10,
BOARD_TARANIS_XLITE, BOARD_TARANIS_XLITE,
BOARD_TARANIS_XLITES, BOARD_TARANIS_XLITES,
BOARD_TARANIS_X9LITE, BOARD_TARANIS_X9LITE
BOARD_ENUM_COUNT
}; };
constexpr int BOARD_TYPE_MAX = BOARD_TARANIS_X9LITE ;
enum PotType enum PotType
{ {
POT_NONE, POT_NONE,