#pragma warning disable 356
#pragma warning disable 1090

#define _XTAL_FREQ	20000000
#include <htc.h>

__CONFIG(0x3F3E);

#include <stdio.h>

/* LCD */
#define LCD_DATA	PORTD
#define LCD_CONTROL	PORTD
#define LCD_RS		3
#define LCD_RW		2
#define LCD_E		1
#include "include/ks0070b.h"

/* EEPROM routines */
#include "include/eeprom.h"

eefloat a;
eefloat b;
char str[16];

main()
{
	TRISD = 0;
	lcdInit();
	lcdInit();
	lcdCmd(LCD_XY(1, LCD_LINE1));
	lcdPuts("Test");
	a = eerfloat(0x00); // -|
	b = eerfloat(0x04); //  |- ezek a problemas sorok
	a.value += 1.5;
	b.value -= 1.5;
	
	eewfloat(0x00, a);
	eewfloat(0x04, b);
	lcdPuts(" *");
	lcdCmd(LCD_XY(1, LCD_LINE2));
	sprintf(str, "a:%.2f b:%.2f", a, b);
	lcdPuts(str);
}