application: Define UART0_IRQHandler().
[gps-watch.git] / src / application / main.rs
index 39e0e022014463e956cc8add88e4d824b510af02..dffa4ee189ebeb1e724057499e0a0b095519b05f 100644 (file)
  */
 
 #![no_std]
-#![crate_type="staticlib"]
+#![no_main]
 #[link(name="libcommon.rlib")]
 
 extern crate common;
 
+mod uart0;
+
 use common::buffer::Buffer;
 use common::clock;
 use common::systick;
@@ -35,6 +37,7 @@ use common::gpio;
 use common::nvic;
 use common::i2c;
 use common::usb_serial;
+use common::display;
 
 extern {
     fn enable_interrupts();
@@ -43,8 +46,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 +76,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);