aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/rev_c/global.h
blob: 50fab581d1f4efcdac8238656d46de56d5531f67 (plain)
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
/*
 * global.h
 *
 * Created: 31/08/2012 8:47:14 PM
 *  Author: Balint Seeber
 */ 

#ifndef GLOBAL_H_
#define GLOBAL_H_

#include <stdbool.h>
#include <stdint.h>
#include <avr/pgmspace.h>

typedef struct State
{
	bool interrupts_enabled;
	uint8_t interrupt_depth;
	//bool timers_running;
	uint8_t active_timers;
	bool powered;
	bool battery_not_present;
	bool battery_charging;
	bool wake_up;
	bool power_off;
	bool core_power_bad;
	bool ltc3675_irq;
#ifdef CHARGER_TI
	bool bq24190_irq;
#else
	bool ltc4155_irq;
#endif // CHARGER_TI
	//bool low_battery;
	uint8_t blink_error;
	uint8_t blinker_state;
	uint8_t blink_loops;
	uint8_t blink_last_loop;
	bool blink_stop;
} STATE;

//extern volatile bool _timers_running;
extern volatile STATE _state;

void pmc_set_blink_error(uint8_t count);
uint8_t pmc_get_blink_error(void);

bool pmc_mask_irqs(bool mask);

#endif /* GLOBAL_H_ */