From 9771416756fdd5f41e9e4bf4c38dc896dd6fb4fe Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Sat, 1 Mar 2014 18:34:19 +0100 Subject: [PATCH] adjusted lcd.c to match this board --- lcd.c | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/lcd.c b/lcd.c index 1a273aa..f575d97 100644 --- a/lcd.c +++ b/lcd.c @@ -16,18 +16,31 @@ #include "timer.h" #include "lcd.h" +//#define WAIT_250_ns() _delay_us(1) +#if (F_CPU <= 4000000UL) #define WAIT_250_ns() _NOP() +#elif (F_CPU <= 8000000UL) +#define WAIT_250_ns() _NOP();_NOP() +#elif (F_CPU <= 12000000UL) +#define WAIT_250_ns() _NOP();_NOP();_NOP() +#elif (F_CPU <= 16000000UL) +#define WAIT_250_ns() _NOP();_NOP();_NOP();_NOP() +#elif (F_CPU <= 20000000UL) +#define WAIT_250_ns() _NOP();_NOP();_NOP();_NOP();_NOP() +#else +#include +#define WAIT_250_ns() _delay_us(1) +#endif -#define LCD_DATA_MODE() (PORTC |= (1<