Commit 6b742351 authored by Projects's avatar Projects

lcd: Removed delays (experimental, revert in case of problems).

parent e65d2db7
......@@ -35,7 +35,6 @@
#include <em_usart.h>
#include <em_rtc.h>
#include <em_timer.h>
#include <udelay.h>
// Frame buffer - pixels are stored as consecutive rows
uint8_t lcd_buffer[LCD_BUF_SIZE];
......@@ -80,16 +79,6 @@ static void spi_transmit(uint8_t *data, uint16_t length)
while(!(LCD_SPI_UNIT->STATUS & USART_STATUS_TXC));
}
static void timer_init(void)
{
UDELAY_Calibrate();
}
static void timer_delay(uint16_t usecs)
{
UDELAY_Delay(usecs);
}
static void extcomin_setup(unsigned int frequency)
{
CMU_ClockEnable(cmuClock_TIMER0, true);
......@@ -158,7 +147,6 @@ void lcd_init(void)
{
uint16_t cmd;
timer_init();
spi_init();
// TODO I am pretty sure, it will be already initialized somewhere..
CMU_ClockEnable(cmuClock_GPIO, true);
......@@ -180,12 +168,10 @@ void lcd_init(void)
// Send command to clear the display
GPIO_PinOutSet(LCD_PORT_SCS, LCD_PIN_SCS);
timer_delay(6);
cmd = LCD_CMD_ALL_CLEAR;
spi_transmit((uint8_t*) &cmd, 2);
timer_delay(2);
GPIO_PinOutClear(LCD_PORT_SCS, LCD_PIN_SCS);
lcd_clear();
......@@ -234,11 +220,9 @@ void lcd_clear(void)
void lcd_update(void)
{
GPIO_PinOutSet(LCD_PORT_SCS, LCD_PIN_SCS);
timer_delay(6);
#ifdef LCD_NODMA
spi_transmit(lcd_buffer, LCD_BUF_SIZE);
timer_delay(2);
GPIO_PinOutClear(LCD_PORT_SCS, LCD_PIN_SCS);
#else
lcd_dma_send_frame();
......
This diff is collapsed.
/**************************************************************************//**
* @file udelay.h
* @brief Microsecond delay routine.
* @version 3.20.5
******************************************************************************
* @section License
* <b>(C) Copyright 2014 Silicon Labs, http://www.silabs.com</b>
*******************************************************************************
*
* This file is licensensed under the Silabs License Agreement. See the file
* "Silabs_License_Agreement.txt" for details. Before using this software for
* any purpose, you must agree to the terms of that agreement.
*
******************************************************************************/
#ifndef __UDELAY_H
#define __UDELAY_H
#include <stdint.h>
/***************************************************************************//**
* @addtogroup Drivers
* @{
******************************************************************************/
/***************************************************************************//**
* @addtogroup Udelay
* @{
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
void UDELAY_Calibrate(void);
void UDELAY_Delay(uint32_t usecs);
#ifdef __cplusplus
}
#endif
/** @} (end group Udelay) */
/** @} (end group Drivers) */
#endif
......@@ -161,7 +161,6 @@ C_SRC += \
../common/gfx/graphics.c \
../common/gfx/gfx.c \
../common/gfx/ui.c \
../common/udelay.c \
FreeRTOS/Source/timers.c \
FreeRTOS/Source/tasks.c \
FreeRTOS/Source/queue.c \
......
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