application: Enable OSC0.
[gps-watch.git] / src / application / main.rs
index 39e0e022014463e956cc8add88e4d824b510af02..e14c8f06e65eeded4d6d54539490ff6ed6510356 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #![no_std]
-#![crate_type="staticlib"]
+#![no_main]
 #[link(name="libcommon.rlib")]
 
 extern crate common;
@@ -35,6 +35,7 @@ use common::gpio;
 use common::nvic;
 use common::i2c;
 use common::usb_serial;
+use common::display;
 
 extern {
     fn enable_interrupts();
@@ -43,8 +44,9 @@ extern {
 }
 
 #[no_mangle]
-pub unsafe extern fn main() {
+pub unsafe extern "C" fn _start() -> ! {
     clock::configure();
+    clock::enable_osc0();
     systick::init();
     port::init();
 
@@ -72,6 +74,11 @@ pub unsafe extern fn main() {
     cdc_tx_buf.write(b"\n");
     cdc_tx_buf.flush();
 
+    let mut display = display::Display::new(gpio::GPIOB, 1 << 16, 0x3c);
+
+    display.init();
+    display.clear();
+
     loop {
         systick::delay_ms(1000);