-
Notifications
You must be signed in to change notification settings - Fork 0
/
power_up.h
72 lines (57 loc) · 1.54 KB
/
power_up.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef POWER_UP_H_INCLUDED
#define POWER_UP_H_INCLUDED
#include <avr/io.h>
// Constant for the powerupdisplay counter to be inactive
#define POWCONST 999
// Defines a number that corresponds to 7 seconds if we iterate it in
// every main loop
#define POWER_UP_TIME 400
enum PowerUP{RED_TANK, MUSHROOM, BIG_DADY, NO_POWERUP};
typedef enum PowerUP powerUp_type;
powerUp_type currentPowerUp;
/**
* If 1 big roomba power up is active
*/
extern uint8_t bigRoombaActive;
/**
* If 1 mushroom power up is active
*/
extern uint8_t mushroomActive;
/**
* Used for counting which state we have when showing the randomize
* symbol on the display
*/
extern int16_t powerUpDisplayCounter;
/**
* Counter for getting 7 seconds
*/
extern uint64_t powerUpTimer;
/**
* \brief Get an random power up and show corresponding information
* on display
*
* \param tickCountRand the tickCount of a wheel, used for initializing
* the random generator
*/
void getPowerUp(uint16_t tickCountRand);
/**
* \brief Perform actions corresponding to shoot a specific power up
*/
void shootPowerUp(void);
/**
* \brief Called from the timer, when
* the time for a power up to be active is over
*/
void powerUpIsOver(void);
/**
* \brief Used for setting the display,
* when power up is generated and steering must not be blocked
* and to finish the process of getting a power up
*/
void showRandomizeSign(void);
/**
* \brief Check if our timer variable should be counted up
* and if interrupt value is reached
*/
void handleTimerVariable(void);
#endif