From f15f2e920da591e68ee0f19b4bbd05543e04c72f Mon Sep 17 00:00:00 2001 From: asterix Date: Fri, 5 Nov 2010 11:00:16 +0000 Subject: [PATCH] Reorder inludes. Move setBacklight to hw file implementation. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4509 38d2e660-2303-0410-9eaa-f027e97ec537 --- boards/sam3n-ek/examples/display/main.c | 41 ++++++++++++------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/boards/sam3n-ek/examples/display/main.c b/boards/sam3n-ek/examples/display/main.c index 54862585..d79775e8 100644 --- a/boards/sam3n-ek/examples/display/main.c +++ b/boards/sam3n-ek/examples/display/main.c @@ -35,21 +35,31 @@ * \author Stefano Fedrigo */ +#include "bitmaps.h" + #include "hw/hw_led.h" #include "hw/hw_lcd.h" -#include "bitmaps.h" + +#include #include + #include #include -#include #include + +#include + #include #include #include + #include + #include + #include + #include #include @@ -60,13 +70,13 @@ #define PROC_STACK_SIZE KERN_MINSTACKSIZE * 2 #if CONFIG_KERN_HEAP -#define hp_stack NULL -#define lp_stack NULL -#define led_stack NULL + #define hp_stack NULL + #define lp_stack NULL + #define led_stack NULL #else -static PROC_DEFINE_STACK(hp_stack, PROC_STACK_SIZE); -static PROC_DEFINE_STACK(lp_stack, PROC_STACK_SIZE); -static PROC_DEFINE_STACK(led_stack, PROC_STACK_SIZE); + static PROC_DEFINE_STACK(hp_stack, PROC_STACK_SIZE); + static PROC_DEFINE_STACK(lp_stack, PROC_STACK_SIZE); + static PROC_DEFINE_STACK(led_stack, PROC_STACK_SIZE); #endif struct SpiDmaAt91 spi; @@ -277,17 +287,6 @@ static void uptime(Bitmap *bm) /* * Lcd */ -static void setBacklight(unsigned level) -{ - unsigned i; - - if (level > LCD_BACKLIGHT_MAX) - level = LCD_BACKLIGHT_MAX; - - for (i = level; i <= LCD_BACKLIGHT_MAX; i++) - LCD_BACKLIGHT_LEVEL_UP(); -} - static void setBrightness(Bitmap *bm) { while (1) @@ -306,7 +305,7 @@ static void setBrightness(Bitmap *bm) { if (++lcd_brightness > LCD_BACKLIGHT_MAX) lcd_brightness = 0; - setBacklight(lcd_brightness); + lcd_setBacklight(lcd_brightness); } } } @@ -361,7 +360,7 @@ int main(void) spi_dma_setclock(LCD_SPICLOCK); lcd_ili9225_init(&spi.fd); LCD_BACKLIGHT_INIT(); - setBacklight(lcd_brightness); + lcd_setBacklight(lcd_brightness); gfx_bitmapInit(&lcd_bitmap, raster, LCD_WIDTH, LCD_HEIGHT); gfx_setFont(&lcd_bitmap, &font_luBS14); -- 2.25.1