gpioled: pass the internal state using a record