verified that interrupts are correctly triggered.
fixed ED return into uint8_t and not int.