From 809b705559a51cac8cd301dbbe7e133e8607fbf6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jul 2015 08:47:30 +0100 Subject: change led code, and print something out --- app/main.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'app/main.c') diff --git a/app/main.c b/app/main.c index 84edc6f..41aa657 100644 --- a/app/main.c +++ b/app/main.c @@ -9,15 +9,15 @@ kbd_dispatch (void) if (ring_read_byte (&rx1_ring, &c)) return; - printf("KEY> %c\r\n",c); + printf ("KEY> %c\r\n", c); } int main (void) { -// rcc_clock_setup_in_hsi_out_48mhz (); - //nvic_set_priority_grouping(NVIC_PriorityGroup_4); + char buf[128]; + int c; /*set up pll */ rcc_clock_setup_in_hse_8mhz_out_72mhz (); @@ -49,9 +49,26 @@ main (void) for (;;) { + if (!ring_empty (&rx1_ring)) kbd_dispatch (); + delay_ms (1000); + + printf ("Counter is %x\n", c); + + sprintf (buf, "%8x", c++); + lcd_write (buf, 0, 1); + + led_set (c & 1 ? LED0 : LED1); + + + + + + + + } return 0; -- cgit v1.2.3