Commit 75f2a8f8 authored by Projects's avatar Projects

lcd: Disable DMA transfers depending on the power saving mode.

parent 5cdb1169
...@@ -218,7 +218,7 @@ void lcd_clear(void) ...@@ -218,7 +218,7 @@ void lcd_clear(void)
uint16_t x, y; uint16_t x, y;
#ifdef FREERTOS #ifdef FREERTOS
if(xSemaphoreTake(lcd_sem, LCD_SEM_TICKS) != pdTRUE) if(xSemaphoreTake(lcd_sem, portMAX_DELAY) != pdTRUE)
return; return;
#endif /* FREERTOS */ #endif /* FREERTOS */
......
...@@ -33,12 +33,13 @@ ...@@ -33,12 +33,13 @@
#ifdef FREERTOS #ifdef FREERTOS
#include <FreeRTOS.h> #include <FreeRTOS.h>
#include <semphr.h> #include <semphr.h>
///> How long should we wait for the semaphore
#define LCD_SEM_TICKS 100
extern xSemaphoreHandle lcd_sem; extern xSemaphoreHandle lcd_sem;
#endif /* FREERTOS */ #endif /* FREERTOS */
//#define LCD_NODMA // DMA is broken when EM2 or deeper is enabled
#if configSLEEP_MODE > 1
#define LCD_NODMA
#endif
// Dimensions // Dimensions
#define LCD_HEIGHT 128 #define LCD_HEIGHT 128
......
...@@ -119,7 +119,7 @@ void lcd_dma_init(void) ...@@ -119,7 +119,7 @@ void lcd_dma_init(void)
void lcd_dma_send_frame(void) void lcd_dma_send_frame(void)
{ {
#ifdef FREERTOS #ifdef FREERTOS
if(xSemaphoreTake(lcd_sem, LCD_SEM_TICKS) != pdTRUE) if(xSemaphoreTake(lcd_sem, portMAX_DELAY) != pdTRUE)
return; return;
#else #else
while(dma_transfer_active); while(dma_transfer_active);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment