summaryrefslogtreecommitdiffstats
path: root/app/main.c
diff options
context:
space:
mode:
authorJames McKenzie <git@madingley.org>2015-08-02 23:30:06 +0100
committerJames McKenzie <git@madingley.org>2015-08-02 23:30:06 +0100
commit39687aa7c7b138d2a1ce2551f2400bade3b1a6fb (patch)
tree25e8441957ddbeff8aae91dc79b6a71ecbef51fe /app/main.c
downloadcandlestick-39687aa7c7b138d2a1ce2551f2400bade3b1a6fb.tar.gz
candlestick-39687aa7c7b138d2a1ce2551f2400bade3b1a6fb.tar.bz2
candlestick-39687aa7c7b138d2a1ce2551f2400bade3b1a6fb.zip
fis
Diffstat (limited to 'app/main.c')
-rw-r--r--app/main.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/main.c b/app/main.c
new file mode 100644
index 0000000..053aa75
--- /dev/null
+++ b/app/main.c
@@ -0,0 +1,39 @@
+#include "project.h"
+extern uint32_t dfu_flag;
+
+int
+main (void)
+{
+ /*set up pll */
+ //rcc_clock_setup_in_hse_8mhz_out_24mhz ();
+ rcc_clock_setup_in_hse_8mhz_out_72mhz ();
+ //rcc_clock_setup_in_hsi_out_48mhz();
+
+ /*turn on clocks to periferals */
+ rcc_periph_clock_enable (RCC_GPIOA);
+ rcc_periph_clock_enable (RCC_GPIOB);
+ rcc_periph_clock_enable (RCC_GPIOC);
+ rcc_periph_clock_enable (RCC_AFIO);
+
+ ticker_init ();
+ led_init ();
+ i2c_bb_init ();
+ lcd_init ();
+
+ lcd_backlight (1);
+ {
+ char buf[16];
+ sprintf(buf,"%x",dfu_flag);
+ lcd_write(buf,0,1);
+}
+
+
+ lcd_write ("hello world", 0, 0);
+
+ usb_init ();
+
+
+ usb_run ();
+
+ return 0;
+}