diff --git a/lib/APPLineFollower/src/States/ReadyState.cpp b/lib/APPLineFollower/src/States/ReadyState.cpp index a87d5af5..a6cdae0e 100644 --- a/lib/APPLineFollower/src/States/ReadyState.cpp +++ b/lib/APPLineFollower/src/States/ReadyState.cpp @@ -79,7 +79,7 @@ void ReadyState::entry() void ReadyState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); if (nullptr == m_lineSensors) { diff --git a/lib/APPLineFollower/src/States/ReleaseTrackState.cpp b/lib/APPLineFollower/src/States/ReleaseTrackState.cpp index 5dbe62c0..85a88f2d 100644 --- a/lib/APPLineFollower/src/States/ReleaseTrackState.cpp +++ b/lib/APPLineFollower/src/States/ReleaseTrackState.cpp @@ -80,7 +80,7 @@ void ReleaseTrackState::entry() void ReleaseTrackState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); /* Change parameter set? */ if (true == Util::isButtonTriggered(button, m_isButtonPressed)) diff --git a/lib/APPLineFollower/src/States/StartupState.cpp b/lib/APPLineFollower/src/States/StartupState.cpp index 16545746..793defc6 100644 --- a/lib/APPLineFollower/src/States/StartupState.cpp +++ b/lib/APPLineFollower/src/States/StartupState.cpp @@ -73,7 +73,7 @@ void StartupState::entry() void StartupState::process(StateMachine& sm) { - IButton& button = Board::getInstance().getButton(); + IButton& button = Board::getInstance().getButtonReset(); switch (m_subState) { diff --git a/lib/HALInterfaces/src/IBoard.h b/lib/HALInterfaces/src/IBoard.h index c3d37c30..28d0d397 100644 --- a/lib/HALInterfaces/src/IBoard.h +++ b/lib/HALInterfaces/src/IBoard.h @@ -93,11 +93,32 @@ class IBoard virtual IBattery& getBattery() = 0; /** - * Get button driver. + * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ - virtual IButton& getButton() = 0; + virtual IButton& getButtonReset() = 0; + + /** + * Get button "A" driver. + * + * @return Button "A" driver. + */ + virtual IButton& getButtonA() = 0; + + /** + * Get button "B" driver. + * + * @return Button "B" driver. + */ + virtual IButton& getButtonB() = 0; + + /** + * Get button "C" driver. + * + * @return Button "C" driver. + */ + virtual IButton& getButtonC() = 0; /** * Get red LED driver. @@ -120,6 +141,27 @@ class IBoard */ virtual ILed& getBlueLed() = 0; + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + virtual ILed& getLedA() = 0; + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + virtual ILed& getLedB() = 0; + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + virtual ILed& getLedC() = 0; + /** * Get Network driver. * diff --git a/lib/HALSim/src/Board.cpp b/lib/HALSim/src/Board.cpp index ad5fb616..bba69437 100644 --- a/lib/HALSim/src/Board.cpp +++ b/lib/HALSim/src/Board.cpp @@ -113,10 +113,16 @@ Board::Board() : m_robot.getReceiver(RobotDeviceNames::RECEIVER_NAME_SERIAL)), m_keyboard(m_simTime, m_robot.getKeyboard()), m_battery(), - m_button(m_keyboard), + m_buttonReset(m_keyboard), + m_buttonA(m_keyboard), + m_buttonB(m_keyboard), + m_buttonC(m_keyboard), m_ledBlue(), m_ledGreen(), m_ledRed(), + m_ledA(), + m_ledB(), + m_ledC(), m_network(), m_hostRobot(m_serialDrv), m_configFilePath(), diff --git a/lib/HALSim/src/Board.h b/lib/HALSim/src/Board.h index 5ef9c547..214b0968 100644 --- a/lib/HALSim/src/Board.h +++ b/lib/HALSim/src/Board.h @@ -47,9 +47,15 @@ #include #include "Battery.h" #include "ButtonReset.h" +#include "ButtonA.h" +#include "ButtonB.h" +#include "ButtonC.h" #include "LedBlue.h" #include "LedGreen.h" #include "LedRed.h" +#include "LedA.h" +#include "LedB.h" +#include "LedC.h" #include "Network.h" #include "Robot.h" #include "WebotsSerialDrv.h" @@ -107,13 +113,43 @@ class Board : public IBoard } /** - * Get button driver. + * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ - IButton& getButton() final + IButton& getButtonReset() final { - return m_button; + return m_buttonReset; + } + + /** + * Get button "A" driver. + * + * @return Button "A" driver. + */ + IButton& getButtonA() final + { + return m_buttonA; + } + + /** + * Get button "B" driver. + * + * @return Button "B" driver. + */ + IButton& getButtonB() final + { + return m_buttonB; + } + + /** + * Get button "C" driver. + * + * @return Button "C" driver. + */ + IButton& getButtonC() final + { + return m_buttonC; } /** @@ -146,6 +182,36 @@ class Board : public IBoard return m_ledRed; } + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + ILed& getLedA() final + { + return m_ledA; + } + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + ILed& getLedB() final + { + return m_ledB; + } + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + ILed& getLedC() final + { + return m_ledC; + } + /** * Get Network driver. * @@ -212,7 +278,16 @@ class Board : public IBoard Battery m_battery; /** Button "Reset" driver */ - ButtonReset m_button; + ButtonReset m_buttonReset; + + /** Button "A" driver */ + ButtonA m_buttonA; + + /** Button "B" driver */ + ButtonB m_buttonB; + + /** Button "C" driver */ + ButtonC m_buttonC; /** Blue LED driver */ LedBlue m_ledBlue; @@ -223,6 +298,15 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; + /** LED "A" driver */ + LedA m_ledA; + + /** LED "B" driver */ + LedB m_ledB; + + /** LED "C" driver */ + LedC m_ledC; + /** Network driver */ Network m_network; diff --git a/lib/HALTargetCommon/src/Board.cpp b/lib/HALTargetCommon/src/Board.cpp index 4fff73a1..b3086ebe 100644 --- a/lib/HALTargetCommon/src/Board.cpp +++ b/lib/HALTargetCommon/src/Board.cpp @@ -117,10 +117,16 @@ void Board::process() Board::Board() : IBoard(), m_battery(), - m_button(), + m_buttonReset(), + m_buttonA(), + m_buttonB(), + m_buttonC(), m_ledBlue(), m_ledGreen(), m_ledRed(), + m_ledA(), + m_ledB(), + m_ledC(), m_network(), m_hostRobot(), m_configFilePath(CONFIG_FILE_PATH) diff --git a/lib/HALTargetCommon/src/Board.h b/lib/HALTargetCommon/src/Board.h index 73f56416..bdacaff6 100644 --- a/lib/HALTargetCommon/src/Board.h +++ b/lib/HALTargetCommon/src/Board.h @@ -46,9 +46,15 @@ #include #include "Battery.h" #include "ButtonReset.h" +#include "ButtonA.h" +#include "ButtonB.h" +#include "ButtonC.h" #include "LedBlue.h" #include "LedGreen.h" #include "LedRed.h" +#include "LedA.h" +#include "LedB.h" +#include "LedC.h" #include "Network.h" #include "ButtonDrv.h" #include "Robot.h" @@ -102,13 +108,43 @@ class Board : public IBoard } /** - * Get button driver. + * Get button "Reset" driver. * - * @return Button driver. + * @return Button "Reset" driver. */ - IButton& getButton() final + IButton& getButtonReset() final { - return m_button; + return m_buttonReset; + } + + /** + * Get button "A" driver. + * + * @return Button "A" driver. + */ + IButton& getButtonA() final + { + return m_buttonA; + } + + /** + * Get button "B" driver. + * + * @return Button "B" driver. + */ + IButton& getButtonB() final + { + return m_buttonB; + } + + /** + * Get button "C" driver. + * + * @return Button "C" driver. + */ + IButton& getButtonC() final + { + return m_buttonC; } /** @@ -141,6 +177,36 @@ class Board : public IBoard return m_ledRed; } + /** + * Get LED "A" driver. + * + * @return LED "A" driver. + */ + ILed& getLedA() final + { + return m_ledA; + } + + /** + * Get LED "B" driver. + * + * @return LED "B" driver. + */ + ILed& getLedB() final + { + return m_ledB; + } + + /** + * Get LED "C" driver. + * + * @return LED "C" driver. + */ + ILed& getLedC() final + { + return m_ledC; + } + /** * Get Network driver. * @@ -187,7 +253,16 @@ class Board : public IBoard Battery m_battery; /** Button "Reset" driver */ - ButtonReset m_button; + ButtonReset m_buttonReset; + + /** Button "A" driver */ + ButtonA m_buttonA; + + /** Button "B" driver */ + ButtonB m_buttonB; + + /** Button "C" driver */ + ButtonC m_buttonC; /** Blue LED driver */ LedBlue m_ledBlue; @@ -198,6 +273,15 @@ class Board : public IBoard /** Red LED driver */ LedRed m_ledRed; + /** LED "A" driver */ + LedA m_ledA; + + /** LED "B" driver */ + LedB m_ledB; + + /** LED "C" driver */ + LedC m_ledC; + /** Network driver */ Network m_network;