X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Flcd_text.c;h=5cdb00581656169fa33a1535394981a8dbd7b9d9;hb=3b1451f6e3161b0f1b16e9be49dd46649b03a9d9;hp=9bff9bb55f2fd476258140c2413868cbe8aa0420;hpb=6eb6ebb5ae5953a27977f0ef66a36344462b949a;p=bertos.git diff --git a/bertos/drv/lcd_text.c b/bertos/drv/lcd_text.c index 9bff9bb5..5cdb0058 100644 --- a/bertos/drv/lcd_text.c +++ b/bertos/drv/lcd_text.c @@ -54,15 +54,16 @@ /** Maximum number of layers. */ #define LCD_LAYERS 6 -#if CONFIG_KERNEL +#if CONFIG_KERN + #include /** Semaphore to arbitrate access to the display. */ static struct Semaphore lcd_semaphore; #define LOCK_LCD sem_obtain(&lcd_semaphore) #define UNLOCK_LCD sem_release(&lcd_semaphore) -#else /* !CONFIG_KERNEL */ +#else /* !CONFIG_KERN */ #define LOCK_LCD do {} while (0) #define UNLOCK_LCD do {} while (0) -#endif /* !CONFIG_KERNEL */ +#endif /* !CONFIG_KERN */ DECLARE_LIST_TYPE(Layer); @@ -91,7 +92,7 @@ void lcd_setAddr(Layer *layer, lcdpos_t addr) layer->addr = addr; } -#if CONFIG_KERNEL +#if CONFIG_KERN void lcd_lock(void) { @@ -104,7 +105,7 @@ void lcd_unlock(void) UNLOCK_LCD; } -#endif /* CONFIG_KERNEL */ +#endif /* CONFIG_KERN */ /** @@ -437,6 +438,10 @@ static void lcd_setDefLayer(Layer *layer) #include void lcd_init(void) { + #if CONFIG_KERN + sem_init(&lcd_semaphore); + #endif + int i; LIST_INIT(&lcd_Layers);