aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/e300/rev_c/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/e300/rev_c/global.h')
-rw-r--r--firmware/e300/rev_c/global.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/e300/rev_c/global.h b/firmware/e300/rev_c/global.h
new file mode 100644
index 000000000..50fab581d
--- /dev/null
+++ b/firmware/e300/rev_c/global.h
@@ -0,0 +1,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_ */