- default:
- //TODO: individual led state unchanged if page arrays are selected in code above
- //avoidable if full pages are written on the fly
- //or use pg8 for individual leds, have pointer to currently on led address for toggling
- if (msg == 0x59 || msg == 0x84) {
- //toggle lock keys on all layers
- for (i=0,i<8,i++) {
- is31_read_register(0, msg, &temp);
- pwm = (temp > 0x00 ? 0x00 : 0xFF);
- is31_write_register(i,msg,pwm);
- }
-
- } else if(msg >= 0x24) {
- xprintf("Power pre-read\ntemp: %X - msg: %X - pwm: %X\n", temp, msg, pwm);
- is31_read_register(7, msg, &temp);
- xprintf("Post-read\ntemp: %X - msg: %X - pwm: %X\n", temp, msg, pwm);
- if (msg == active_led) {
- //toggle led power
- pwm = (temp > 0x00 ? 0x00 : 0xFF);
-
- //Use 8th led page for individual led indicators
- is31_write_register(7, msg, pwm);
- } else {
- is31_write_register(7, active_led, 0x00);
- is31_write_register(7, msg, 0xFF);
- }
- xprintf("Power post-change\ntemp: %X - msg: %X - pwm: %X\n", temp, msg, pwm);
- is31_write_register(IS31_FUNCTIONREG, IS31_REG_PICTDISP, 7);
- }
- break;