Switch LEDs to match selected tool
parent
2053729a75
commit
a2a1b8a698
|
|
@ -7,6 +7,8 @@ namespace config {
|
||||||
|
|
||||||
static constexpr const uint8_t toolCount = 5U; ///< Max number of extruders/tools/slots
|
static constexpr const uint8_t toolCount = 5U; ///< Max number of extruders/tools/slots
|
||||||
|
|
||||||
|
static constexpr const uint8_t ledCount = 10U; ///< LED count
|
||||||
|
|
||||||
/// Absolute positions for Idler's slots: 0-4 are the real ones, the 5th index is the idle position
|
/// Absolute positions for Idler's slots: 0-4 are the real ones, the 5th index is the idle position
|
||||||
static constexpr U_deg idlerSlotPositions[toolCount + 1] = {
|
static constexpr U_deg idlerSlotPositions[toolCount + 1] = {
|
||||||
45.0_deg,
|
45.0_deg,
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ void setup() {
|
||||||
// watchdog init
|
// watchdog init
|
||||||
|
|
||||||
shr16::shr16.Init();
|
shr16::shr16.Init();
|
||||||
ml::leds.SetMode(4, ml::Color::green, ml::Mode::blink0);
|
ml::leds.SetMode(0, ml::Color::green, ml::Mode::on);
|
||||||
ml::leds.Step();
|
ml::leds.Step();
|
||||||
|
|
||||||
// @@TODO if the shift register doesn't work we really can't signalize anything, only internal variables will be accessible if the UART works
|
// @@TODO if the shift register doesn't work we really can't signalize anything, only internal variables will be accessible if the UART works
|
||||||
|
|
@ -108,7 +108,7 @@ void setup() {
|
||||||
.baudrate = 115200,
|
.baudrate = 115200,
|
||||||
};
|
};
|
||||||
hu::usart1.Init(&usart_conf);
|
hu::usart1.Init(&usart_conf);
|
||||||
ml::leds.SetMode(3, ml::Color::green, ml::Mode::on);
|
ml::leds.SetMode(1, ml::Color::green, ml::Mode::on);
|
||||||
ml::leds.Step();
|
ml::leds.Step();
|
||||||
|
|
||||||
// @@TODO if both shift register and the UART are dead, we are sitting ducks :(
|
// @@TODO if both shift register and the UART are dead, we are sitting ducks :(
|
||||||
|
|
@ -127,12 +127,13 @@ void setup() {
|
||||||
ml::leds.Step();
|
ml::leds.Step();
|
||||||
|
|
||||||
// tmc::Init()
|
// tmc::Init()
|
||||||
ml::leds.SetMode(1, ml::Color::green, ml::Mode::on);
|
ml::leds.SetMode(3, ml::Color::green, ml::Mode::on);
|
||||||
ml::leds.Step();
|
ml::leds.Step();
|
||||||
|
|
||||||
adc::Init();
|
adc::Init();
|
||||||
ml::leds.SetMode(0, ml::Color::green, ml::Mode::on);
|
ml::leds.SetMode(4, ml::Color::green, ml::Mode::on);
|
||||||
ml::leds.Step();
|
ml::leds.Step();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr const uint8_t maxMsgLen = 10;
|
static constexpr const uint8_t maxMsgLen = 10;
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ public:
|
||||||
/// @param color green or red LED
|
/// @param color green or red LED
|
||||||
/// @param mode to set
|
/// @param mode to set
|
||||||
inline void SetMode(uint8_t slot, Color color, Mode mode) {
|
inline void SetMode(uint8_t slot, Color color, Mode mode) {
|
||||||
SetMode(slot * 2 + color, mode);
|
SetMode(((config::ledCount/2-1)-slot) * 2 + color, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the mode of a LED in a pair
|
/// Sets the mode of a LED in a pair
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue