IO: Implemented switches, moved adc stuff a bit.

Game logic: Implemented instruction screen, where players can choose color/game-speed. Missing: Adc read in
Refactoring in game.{c,h} : Spliting up large funcitons. Shortening defines.
This commit is contained in:
T-moe
2016-01-29 01:04:26 +01:00
parent 0d1085ece7
commit 913eba8f6f
4 changed files with 297 additions and 199 deletions

View File

@@ -26,11 +26,6 @@ void io_process(void);
*/
bool io_button_has_edge(uint8_t btnnumber);
/**
* @brief Initialize the analog/digital converter in order to read the potentiometer.
*/
void init_adc();
/**
* @brief Read a value from the analog/digital converter.
*
@@ -38,15 +33,13 @@ void init_adc();
*/
uint16_t read_adc();
/**
* @brief Uses buttons s0-7 to determine the coler of the player.
* Player1 is represented by the bits s0-3.
* Player2 is represented by the bits s4-s7.
* @brief Read the values of the 8 switches
*
* @param player Playerobject
* @param first_player Specify first or second player
* @return Color value for the according player
* @return Returns the state of the switches, one bit per switch, high active
*/
uint16_t get_player_color(player_t* player, bool first_player);
uint8_t read_switches();
#endif /* IO_H */