Comply the demo project to new spi dma interface.
[bertos.git] / boards / sam3n-ek / examples / display / main.c
index d79775e8d523fe1b8a408624b81719aecfa53197..260ada0fa590c8a803d2e4886d652a627cad5374 100644 (file)
@@ -48,7 +48,7 @@
 #include <drv/kbd.h>
 #include <drv/lcd_ili9225.h>
 
-#include <cpu/arm/drv/spi_dma_at91.h>
+#include <drv/spi_dma.h>
 
 #include <gfx/gfx.h>
 #include <gfx/font.h>
@@ -79,7 +79,7 @@
        static PROC_DEFINE_STACK(led_stack, PROC_STACK_SIZE);
 #endif
 
-struct SpiDmaAt91 spi;
+struct SpiDma spi;
 static uint8_t raster[RAST_SIZE(LCD_WIDTH, LCD_HEIGHT)];
 static Bitmap lcd_bitmap;
 extern Font font_gohu;
@@ -88,26 +88,6 @@ static Process *hp_proc, *lp_proc, *led_proc;
 static hptime_t start, end;
 
 
-INLINE void led_on(int idx)
-{
-       if (idx == 0)
-               LED_BLUE_ON();
-       else if (idx == 1)
-               LED_GREEN_ON();
-       else if (idx == 2)
-               LED_AMBER_ON();
-}
-
-INLINE void led_off(int idx)
-{
-       if (idx == 0)
-               LED_BLUE_OFF();
-       else if (idx == 1)
-               LED_GREEN_OFF();
-       else if (idx == 2)
-               LED_AMBER_OFF();
-}
-
 static bool led_blinking;
 
 static void NORETURN led_process(void)
@@ -118,14 +98,14 @@ static void NORETURN led_process(void)
        {
                if (!led_blinking)
                {
-                       led_off(0);
-                       led_off(1);
-                       led_off(2);
+                       LED_OFF(0);
+                       LED_OFF(1);
+                       LED_OFF(2);
                        sig_wait(SIG_USER0);
                }
-               led_on(i % 3);
-               led_off((i-1) % 3);
-               timer_delay(100);
+               LED_ON(i % 3);
+               LED_OFF((i-1) % 3);
+               timer_delay(200);
        }
 }