From 6d1ad6da9245309ab4ffc65224053db2420ccb51 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 29 Mar 2019 22:16:46 -0230 Subject: [PATCH] Reactivate some code that was commented out in the last commit(s). --- src/debugger/gui/RiotWidget.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx index 715955bb3..e8c800de0 100644 --- a/src/debugger/gui/RiotWidget.cxx +++ b/src/debugger/gui/RiotWidget.cxx @@ -396,18 +396,17 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) break; case kSWCHARBitsID: { -#if 0 - // TODO: Check if there is a nicer way to do this value = Debugger::get_bits(mySWCHAReadBits->getState()); - riot.controller(Controller::Jack::Left).set(Controller::DigitalPin::One, value & 0b00010000); - riot.controller(Controller::Jack::Left).set(Controller::DigitalPin::Two, value & 0b00100000); - riot.controller(Controller::Jack::Left).set(Controller::DigitalPin::Three, value & 0b01000000); - riot.controller(Controller::Jack::Left).set(Controller::DigitalPin::Four, value & 0b10000000); - riot.controller(Controller::Jack::Right).set(Controller::DigitalPin::One, value & 0b00000001); - riot.controller(Controller::Jack::Right).set(Controller::DigitalPin::Two, value & 0b00000010); - riot.controller(Controller::Jack::Right).set(Controller::DigitalPin::Three, value & 0b00000100); - riot.controller(Controller::Jack::Right).set(Controller::DigitalPin::Four, value & 0b00001000); -#endif + ControllerLowLevel lport(instance().console().leftController()); + ControllerLowLevel rport(instance().console().rightController()); + lport.setPin(Controller::DigitalPin::One, value & 0b00010000); + lport.setPin(Controller::DigitalPin::Two, value & 0b00100000); + lport.setPin(Controller::DigitalPin::Three, value & 0b01000000); + lport.setPin(Controller::DigitalPin::Four, value & 0b10000000); + rport.setPin(Controller::DigitalPin::One, value & 0b00000001); + rport.setPin(Controller::DigitalPin::Two, value & 0b00000010); + rport.setPin(Controller::DigitalPin::Three, value & 0b00000100); + rport.setPin(Controller::DigitalPin::Four, value & 0b00001000); break; } }