From 4c9ce0b57b87a1dd3f94849a967680397774c5db Mon Sep 17 00:00:00 2001 From: Adam Long Date: Sat, 7 Feb 2015 10:37:19 +0000 Subject: [PATCH] Changed DIO Get if statement to a case --- Subsystems/DIO.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Subsystems/DIO.cpp b/Subsystems/DIO.cpp index d282e01..470bf3a 100644 --- a/Subsystems/DIO.cpp +++ b/Subsystems/DIO.cpp @@ -7,12 +7,15 @@ DIO::DIO(){ void DIO::InitDefaultCommand(){ } bool DIO::Get(e_dioSig dioSig){ - if(dioSig == ELEVATORTOP){ - // The top elevator digitalinput was triggered - return elevatorTop->Get(); - }else if(dioSig == ELEVATORBOTTOM){ - // The buttom elevator digitalinput was triggered - return elevatorBottom->Get(); + switch (dioSig){ + case ELEVATORTOP: + return elevatorTop->Get(); + break; + case ELEVATORBOTTOM: + return elevatorBottom->Get(); + break; + default: + return false; + break; } - return false; }