A rouge-like rpg, heavily inspired on the binding of isaac. Running on a FRDM-K64F Mbed board. C++.
Dependencies: mbed MotionSensor
Diff: Gamepad/Gamepad.h
- Revision:
- 21:be18f33da757
- Parent:
- 9:304079450898
diff -r bfe410c82b45 -r be18f33da757 Gamepad/Gamepad.h --- a/Gamepad/Gamepad.h Thu Apr 25 03:56:09 2019 +0000 +++ b/Gamepad/Gamepad.h Thu Apr 25 05:27:43 2019 +0000 @@ -50,21 +50,21 @@ class Gamepad { public: -/** Gamepad events - * @brief List of events that can be registered on the gamepad - */ -enum GamepadEvent { - A_PRESSED, ///< Button A has been pressed - B_PRESSED, ///< Button B has been pressed - X_PRESSED, ///< Button X has been pressed - Y_PRESSED, ///< Button Y has been pressed - L_PRESSED, ///< Button L has been pressed - R_PRESSED, ///< Button R has been pressed - BACK_PRESSED, ///< Button "Back" has been pressed - START_PRESSED, ///< Button "Start" has been pressed - JOY_PRESSED, ///< Joystick button has been pressed - N_EVENTS ///< A dummy flag that marks the end of the list -}; + /** Gamepad events + * @brief List of events that can be registered on the gamepad + */ + enum GamepadEvent { + A_PRESSED, ///< Button A has been pressed + B_PRESSED, ///< Button B has been pressed + X_PRESSED, ///< Button X has been pressed + Y_PRESSED, ///< Button Y has been pressed + L_PRESSED, ///< Button L has been pressed + R_PRESSED, ///< Button R has been pressed + BACK_PRESSED, ///< Button "Back" has been pressed + START_PRESSED, ///< Button "Start" has been pressed + JOY_PRESSED, ///< Joystick button has been pressed + N_EVENTS ///< A dummy flag that marks the end of the list + }; private: mbed::PwmOut *_led1; @@ -153,7 +153,8 @@ * std::cout << gamepad.get_raw_event_state() << std::endl; * @endcode */ - inline std::bitset<N_EVENTS> get_raw_event_state() const { + inline std::bitset<N_EVENTS> get_raw_event_state() const + { return _event_state; } @@ -190,7 +191,7 @@ private: void init_buttons(); void tone_off(); - + void a_reset_isr(); void b_reset_isr(); void x_reset_isr(); @@ -200,7 +201,7 @@ void back_reset_isr(); void start_reset_isr(); void joy_reset_isr(); - + void a_isr(); void b_isr(); void x_isr();