Skip to content

Commit

Permalink
Added support for SZP
Browse files Browse the repository at this point in the history
  • Loading branch information
dc42 committed Jul 25, 2023
1 parent f85ba89 commit 005ff43
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/BoardType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ enum class BoardId : unsigned int
tool1lc_v0 = 0,
exp1hce_v0,
ate,
szp,
exp1xd_v0,
tool1lc_v1,

Expand All @@ -243,6 +244,7 @@ constexpr const char * BoardTypeNames[] =
"TOOL1LC", // version 1.0 or earlier
"EXP1HCE",
"unknown", // for ATE we need to look at the second board type pin
"SZP",
"EXP1XD",
"TOOL1LC", // version 1.1 or later

Expand All @@ -257,6 +259,7 @@ constexpr unsigned int BoardTypeVersions[] =
0,
0,
0,
0,
1,
0,
0
Expand All @@ -267,6 +270,7 @@ constexpr const Pin *LedPinsTables[] =
LedPins_Tool1LC_v0,
LedPins_Exp1HCE,
LedPins_Ate,
LedPins_SZP,
LedPins_Exp1XD,
LedPins_Tool1LC_v1,
LedPins_Ate,
Expand All @@ -278,6 +282,7 @@ constexpr bool LedActiveHigh[] =
LedActiveHigh_Tool1LC_v0,
LedActiveHigh_Exp1HCE,
LedActiveHigh_Ate,
LedActiveHigh_SZP,
LedActiveHigh_Exp1XD,
LedActiveHigh_Tool1LC_v1,
LedActiveHigh_Ate,
Expand All @@ -289,6 +294,7 @@ constexpr Pin CanResetPins[] =
CanResetPin_Tool1LC,
CanResetPin_Exp1HCE,
NoPin,
CanResetPin_SZP,
CanResetPin_Exp1XD,
CanResetPin_Tool1LC,
CanResetPin_AteCM,
Expand All @@ -301,6 +307,7 @@ constexpr float BoardTypeFractions[] =
1.0/(1.0 + 10.0), // TOOL1LC v1.0 has 1K lower resistor, 10K upper
4.7/(4.7 + 27.0), // EXP1HCE has 4K7 lower resistor, 27K upper
3.0/(3.0 + 12.0), // ATECM and ATEIO have 3K lower, 12K upper
4.7/(4.7 + 10.0), // SZP has 4K7 lower, 10K upper
4.7/(4.7 + 4.7), // EXP1XD has 4K7 lower resistor, 4K7 upper
10.0/(1.0 + 10.0), // TOOL1LC v1.1 has 10K lower resistor, 1K upper
};
Expand All @@ -313,7 +320,8 @@ constexpr uint16_t BoardIdDecisionPoints[] =
(uint16_t)((BoardTypeFractions[0] + BoardTypeFractions[1]) * (AdcRange/2)),
(uint16_t)((BoardTypeFractions[1] + BoardTypeFractions[2]) * (AdcRange/2)),
(uint16_t)((BoardTypeFractions[2] + BoardTypeFractions[3]) * (AdcRange/2)),
(uint16_t)((BoardTypeFractions[3] + BoardTypeFractions[4]) * (AdcRange/2))
(uint16_t)((BoardTypeFractions[3] + BoardTypeFractions[4]) * (AdcRange/2)),
(uint16_t)((BoardTypeFractions[4] + BoardTypeFractions[5]) * (AdcRange/2))
};

static_assert(ARRAY_SIZE(BoardIdDecisionPoints) + 1 == ARRAY_SIZE(BoardTypeFractions));
Expand Down
4 changes: 4 additions & 0 deletions src/Config/SAMC21config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ constexpr Pin OutPins_Tool1LC[] = { PortAPin(11), PortAPin(10), PortBPin(11) };
constexpr Pin ButtonPins_Tool1LC[] = { PortBPin(22), PortBPin(23) };

constexpr Pin CanResetPin_Tool1LC = PortBPin(22); // first button pin
constexpr Pin CanResetPin_SZP = PortAPin(18);
constexpr Pin CanResetPin_Exp1XD = PortAPin(27);
constexpr Pin CanResetPin_Exp1HCE = NoPin;
constexpr Pin CanResetPin_AteCM = NoPin; // the CAN jumper on the ATECM is connected between AteCmJumperPin and AteCmZeroPin
Expand All @@ -62,6 +63,9 @@ constexpr bool LedActiveHigh_Tool1LC_v0 = true;
constexpr Pin LedPins_Tool1LC_v1[NumLedPins] = { PortAPin(30), PortAPin(31) };
constexpr bool LedActiveHigh_Tool1LC_v1 = false;

constexpr Pin LedPins_SZP[NumLedPins] = { PortAPin(30), PortAPin(31) };
constexpr bool LedActiveHigh_SZP = false;

constexpr Pin LedPins_Exp1XD[NumLedPins] = { PortAPin(19), PortAPin(18) };
constexpr bool LedActiveHigh_Exp1XD = true;

Expand Down
2 changes: 1 addition & 1 deletion src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#ifndef SRC_VERSION_H_
#define SRC_VERSION_H_

#define VERSION_TEXT "2.7 (2023-06-21)"
#define VERSION_TEXT "2.8 (2023-07-25)"

#endif /* SRC_VERSION_H_ */

0 comments on commit 005ff43

Please sign in to comment.