#include <mega8.h>
#include "s65_lib.h"
#include <spi.h>

//int i=1;
//int b=0; 

/*
interrupt [EXT_INT0] void ext_int0_isr(void)
{
if (i<6) i++;
else i=0;
}
*/


struct menu 
        {
            char Pos1[];
            char Pos2[];
        };
        
interrupt [EXT_INT0] void ext_int0_isr(void)
{
//b=1; 
lcd_poweroff (); 
}


void main(void)
{
struct menu MENU_1= {"LED1", "LED2"};

struct menu *ptr=&MENU_1;

const char text[]=" dima ";
const char text1[]=" hello ";

#asm("cli")

GICR|=0x40;
MCUCR=0x02;
GIFR=0x40;

TIMSK=0x00;

ACSR=0x80;
SFIOR=0x00;

m8_init_port();
lcd_init();

//fill_screen(white);
put_string(10,20,text,blue);
put_string(10,35,text1,pink);

//delay_ms(50);

put_string(10,50, (*ptr).Pos1, red);

#asm("sei")

while (1)
      { 
        //if (i==1) put_string(10,30,MENU_1.Pos1, red);
        //if (i==2) put_string(10,30,MENU_1.Pos2,green);
        //if (i==3) put_string(10,30,MENU_1.Pos3,pink);
        //if (i==4) put_string(10,30,MENU_1.Pos4,grey);
        //if (b==1) lcd_poweroff ();
      };
}
