Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
app_blink_k20: Test uart
Browse files Browse the repository at this point in the history
  • Loading branch information
bgamari committed Oct 18, 2014
1 parent ab2918d commit 04edc59
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/app_blink_k20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ use zinc::hal::k20::{pin, watchdog};
use zinc::hal::pin::GPIO;
use zinc::hal::cortex_m4::systick;

use zinc::drivers::chario::CharIO;
use zinc::hal::uart::{Disabled};
use zinc::hal::k20::uart::{UART, UART0};

/// Wait the given number of SysTick ticks
pub fn wait(ticks: u32) {
let mut n = ticks;
Expand Down Expand Up @@ -39,10 +43,13 @@ pub unsafe fn main() {

systick::setup(systick::ten_ms().unwrap_or(480000));
systick::enable();

let uart = UART::new(UART0, 115200, 8, Disabled, 1);
loop {
led1.set_high();
wait(10);
uart.puts("hi\n");
led1.set_low();
wait(10);
wait(100);
}
}

0 comments on commit 04edc59

Please sign in to comment.