5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
27 // TODO create a Board class with all these functions
115 FactoryInstalledSwitches
,
126 struct SwitchPosition
{
127 SwitchPosition(unsigned int index
, unsigned int position
):
133 unsigned int position
;
142 Boards(Board::Type board
)
147 void setBoardType(const Board::Type
& board
);
148 Board::Type
getBoardType() const { return m_boardType
; }
150 const int getEEpromSize() { return getEEpromSize(m_boardType
); }
151 const int getFlashSize() { return getFlashSize(m_boardType
); }
152 const Board::SwitchInfo
getSwitchInfo(unsigned index
) { return getSwitchInfo(m_boardType
, index
); }
153 const int getCapability(Board::Capability capability
) { return getCapability(m_boardType
, capability
); }
155 static const int getEEpromSize(Board::Type board
);
156 static const int getFlashSize(Board::Type board
);
157 static const Board::SwitchInfo
getSwitchInfo(Board::Type board
, unsigned index
);
158 static const int getCapability(Board::Type board
, Board::Capability capability
);
159 static const QString
getAxisName(int index
);
163 Board::Type m_boardType
;
166 // temporary aliases for transition period, use Boards class instead.
167 #define getBoardCapability(b__, c__) Boards::getCapability(b__, c__)
168 #define getEEpromSize(b__) Boards::getEEpromSize(b__)
169 #define getSwitchInfo(b__, i__) Boards::getSwitchInfo(b__, i__)
171 #define IS_9X(board) (board==Board::BOARD_STOCK || board==Board::BOARD_M128)
172 #define IS_STOCK(board) (board==Board::BOARD_STOCK)
173 #define IS_2560(board) (board==Board::BOARD_GRUVIN9X || board==Board::BOARD_MEGA2560)
174 #define IS_SKY9X(board) (board==Board::BOARD_SKY9X || board==Board::BOARD_9XRPRO || board==Board::BOARD_AR9X)
175 #define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO)
176 #define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
177 #define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
178 #define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP)
179 #define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
180 #define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
181 #define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board))
182 #define IS_HORUS_X12S(board) (board==Board::BOARD_X12S)
183 #define IS_HORUS_X10(board) (board==Board::BOARD_X10)
184 #define IS_HORUS(board) (IS_HORUS_X12S(board) || IS_HORUS_X10(board))
185 #define IS_HORUS_OR_TARANIS(board) (IS_HORUS(board) || IS_TARANIS(board))
186 #define IS_FLAMENCO(board) (board==Board::BOARD_FLAMENCO)
187 #define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
188 #define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
189 #define HAS_LARGE_LCD(board) (IS_HORUS(board) || (IS_TARANIS(board) && !IS_TARANIS_X7(board)))