-/* $Id: main.c,v 1.4 2010/06/30 19:39:28 simimeie Exp $
+/* $Id: main.c,v 1.5 2010/07/01 23:56:19 simimeie Exp $
* Main file for the HaWo moodlight.
* This is the main file that glues it all together. It also contains all
* functionality that is too small to require an extra file.
if (ledpwm_bri > 0) { ledpwm_bri--; }
}
break;
+ case 0x02: /* "Off" */
+ ledpwm_bri = 0;
+ break;
+ case 0x03: /* "On" */
+ ledpwm_bri = 128;
+ break;
case 0x04: /* Red */
if (irstate == IRSTATE_RED) {
ledpwm_re = 0xff; ledpwm_gr = 0; ledpwm_bl = 0;
ledpwm_re = 0xff; ledpwm_gr = 0x40; ledpwm_bl = 0x00;
irstate = 0;
break;
+ case 0x09: /* greenish cyan */
+ ledpwm_re = 0x00; ledpwm_gr = 0xff; ledpwm_bl = 0x80;
+ irstate = 0;
+ break;
case 0x0c: /* orange */
ledpwm_re = 0xff; ledpwm_gr = 0x80; ledpwm_bl = 0x00;
irstate = 0;
break;
+ case 0x0d: /* cyan */
+ ledpwm_re = 0x00; ledpwm_gr = 0xff; ledpwm_bl = 0xff;
+ irstate = 0;
+ break;
case 0x10: /* bright orange */
ledpwm_re = 0xff; ledpwm_gr = 0xc0; ledpwm_bl = 0x00;
irstate = 0;
break;
+ case 0x11: /* blueish cyan */
+ ledpwm_re = 0x00; ledpwm_gr = 0xa0; ledpwm_bl = 0xff;
+ irstate = 0;
+ break;
case 0x14: /* yellow */
ledpwm_re = 0xff; ledpwm_gr = 0xff; ledpwm_bl = 0x00;
irstate = 0;
break;
+ case 0x15: /* blueerish cyan */
+ ledpwm_re = 0x00; ledpwm_gr = 0x60; ledpwm_bl = 0xff;
+ irstate = 0;
+ break;
};
ledpwm_setled(LEDPWM_REDLED, (((uint16_t)ledpwm_re * ledpwm_bri) / 255));
ledpwm_setled(LEDPWM_GREENLED, (((uint16_t)ledpwm_gr * ledpwm_bri) / 255));