Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/Tasks.cpp')
-rw-r--r--src/Platform/Tasks.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Platform/Tasks.cpp b/src/Platform/Tasks.cpp
index 7d7c39e8..4d42d332 100644
--- a/src/Platform/Tasks.cpp
+++ b/src/Platform/Tasks.cpp
@@ -128,8 +128,19 @@ void *Tasks::GetNVMBuffer(const uint32_t *_ecv_array null stk) noexcept
// Application entry point
[[noreturn]] void AppMain() noexcept
{
+#if defined(DUET3_MB6HC) // for MB6HC the Status and Activity pins and polarity depend on the board version
+ const BoardType bt = Platform::GetMB6HCBoardType();
+ const Pin DiagPin = (bt == BoardType::Duet3_6HC_v102) ? DiagPin102 : DiagPinPre102;
+ const Pin ActLedPin = (bt == BoardType::Duet3_6HC_v102) ? ActLedPin102 : ActLedPinPre102;
+ const bool DiagOnPolarity = (bt == BoardType::Duet3_6HC_v102) ? DiagOnPolarity102 : DiagOnPolarityPre102;
+ if (bt == BoardType::Duet3_6HC_v102)
+ {
+ pinMode(UsbPowerSwitchPin, OUTPUT_LOW); // turn USB power off
+ pinMode(UsbModePin, OUTPUT_LOW); // USB mode = device/UFP
+ }
+#endif
pinMode(DiagPin, (DiagOnPolarity) ? OUTPUT_LOW : OUTPUT_HIGH); // set up status LED for debugging and turn it off
-#if defined(DUET3MINI) || defined(DUET3_MB6XD)
+#if defined(DUET3MINI) || defined(DUET3_MB6HC) || defined(DUET3_MB6XD)
pinMode(ActLedPin, (ActOnPolarity) ? OUTPUT_LOW : OUTPUT_HIGH); // set up activity LED and turn it off
#endif