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<