Statistics
| Revision:

root / trunk / bootloader / addr.c @ 293

History | View | Annotate | Download (326 Bytes)

1
#include "addr.h"
2
3
uint8_t read_addr(void) {
4
    uint8_t a, b, c;
5
6
    a = eeprom_read_byte(EEPROM_ADDR1);
7
    b = eeprom_read_byte(EEPROM_ADDR2);
8
    c = eeprom_read_byte(EEPROM_ADDR3);
9
10
    if ((a == b) || a == c) {
11
        return a;
12
    } else if (b == c) {
13
        return b;
14
    } else {
15
        return ID_BROKEN;
16
    }
17
}