#include #include "main.h" #include "settings.h" #include "display.h" #include "xprintf.h" EEMEM struct config_s config_eep; EEMEM unsigned char config_crc; unsigned char settings_load(void) { /* 0 - ok, 1 - error */ unsigned char crc=0, rcrc, i; unsigned char *cptr = (unsigned char *)&System.conf; unsigned char ret; eeprom_read_block(cptr, &config_eep, sizeof(struct config_s)); for (i=0; i ")); else strcpy_P(disp.line2, PSTR("< Nie > ")); strcat_P(disp.line2, have_next?PSTR(" \x01"):PSTR(" ")); /* down arrow */ strcat_P(disp.line2, have_prev?PSTR(" \x02"):PSTR(" ")); /* up arrow */ } unsigned char get_flag(unsigned char index) { volatile unsigned char *sptr = &System.conf.flags[index/8]; index %= 8; unsigned char val = (*sptr) & _BV(index); return val; } void set_flag(unsigned char index, unsigned char val) { volatile unsigned char *sptr = &System.conf.flags[index/8]; index %= 8; if (val) *sptr |= _BV(index); else *sptr &= ~_BV(index); }