Hugo Hu / Mbed 2 deprecated BRAVEHEART

Dependencies:   mbed N5110 ShiftReg PinDetect

Revision:
10:f2488a0ecab7
Parent:
7:678873947b29
Child:
12:8178fad5e660
--- a/MainMenu.cpp	Sun May 03 11:48:42 2015 +0000
+++ b/MainMenu.cpp	Fri May 08 14:39:36 2015 +0000
@@ -1,7 +1,10 @@
 #include "MainMenu.h"
 
+/// States for the Main Menu's internal finite state machine
 enum MenuState {SELECT_PLAY, SELECT_HIGHSCORES, SELECT_CONTROLS, LOAD_GAME, HIGHSCORES, CONTROLS};
-// Static variables for internal fsm
+
+/// Static variables for internal fsm.
+
 const int MainMenu::MENU_FSM[6][3] = {
     {LOAD_GAME, SELECT_PLAY, SELECT_HIGHSCORES},            // State: SELECT_PLAY
     {HIGHSCORES, SELECT_HIGHSCORES, SELECT_CONTROLS},       // State: SELECT_HIGHSCORES
@@ -11,7 +14,7 @@
     {SELECT_CONTROLS, SELECT_CONTROLS, CONTROLS}            // State: CONTROLS
 };
 
-int MainMenu::currentState;
+int MainMenu::currentState; /// Current state for the state machine
 
 // Callback functions (needs to be static)
 void MainMenu::btnAPress()
@@ -32,15 +35,12 @@
 void MainMenu::init()
 {
     MainMenu::currentState = SELECT_PLAY;
-    input->addBtnPressInterrupt(input->btnA, &btnAPress);
-    input->addBtnPressInterrupt(input->btnB, &btnBPress);
-    input->addBtnPressInterrupt(input->btnC, &btnCPress);
+    input->addBtnPressInterrupt(Input::ButtonA, &btnAPress);
+    input->addBtnPressInterrupt(Input::ButtonB, &btnBPress);
+    input->addBtnPressInterrupt(Input::ButtonC, &btnCPress);
 }
 
-void MainMenu::update(float dt)
-{
-    
-}
+void MainMenu::update(float dt) {} // Does not do anything as program flow is controlled by interrupts, but needs to be defined as it is a virtual function.
 
 void MainMenu::render()
 {