summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcsapce.com>2022-09-27 16:14:28 -0500
committerBrett Weiland <brett_weiland@bpcsapce.com>2022-09-27 16:14:28 -0500
commit94304b11e7220f060dbc345de5fa1952d0465016 (patch)
treef16e84c54b27f67e089ded1175fbf8b561896b42 /src/main.c
parent7b006d6f2032ac46074d693ae59a971bee327ace (diff)
working on serial syncronization for programming eeprom
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 46f2f3b..93903c9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,6 +7,9 @@
#include "ssd1306_display_driver.h"
#include "debug.h" //TODO move to timer
#include "br24t_eeprom_driver.h"
+#include "pcf_clock_driver.h"
+#include "pins.h"
+#include "uart.h"
/**
* TODO
* make sure desired functions are static (it's just good practice)
@@ -19,37 +22,41 @@
*/
-#if defined(DEBUG_BUILD) || defined(EEPROM_INSTALL)
-#include "uart.h" //TODO remove if needed
-#endif
int main() {
+ LED_DEBUG_DDR |= _BV(LED_DEBUG); //TODO move to debug file or somethin
+ LED_DEBUG_PORT &= ~(_BV(LED_DEBUG));
//initlizes i2c, right now only speed //TODO don't delegate a whole function if desired
i2c_init();
- screen_init();
-#if defined(DEBUG_BUILD) || defined(EEPROM_INSTALL)
- //initlizes usart registers
+ //screen_init();
+#if defined(DEBUG_BUILD) || defined(FLASH_EEPROM)
+
uart_init();
FILE stdout_replacement = FDEV_SETUP_STREAM((void *)uart_sendbyte, NULL, _FDEV_SETUP_WRITE);
FILE stdin_replacement = FDEV_SETUP_STREAM(NULL, (void *)uart_recvbyte, _FDEV_SETUP_READ);
stdout = &stdout_replacement;
stdin = &stdin_replacement;
- screen_testdraw();
+
+ //screen_lowlvl_testdraw();
+ //eeprom_testbyte();
+ //test_clock();
#endif
+
//initilize timer
timer_init();
-#ifdef EEPROM_INSTALL
+#ifdef FLASH_EEPROM
+ //uart_echo();
flash_eeprom();
#endif
//initlizes screen registers with good values since we dont have control over reset functionallity
- screen_init();
+ //screen_init();
return 0;
}