[tuxdroid-svn] r872 - daemon/trunk/libs
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-01-24 10:44:54
|
Author: Paul_R Date: 2008-01-24 11:44:51 +0100 (Thu, 24 Jan 2008) New Revision: 872 Modified: daemon/trunk/libs/USBDaemon_status_table.c Log: * Improved the LEDs status Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2008-01-23 18:20:52 UTC (rev 871) +++ daemon/trunk/libs/USBDaemon_status_table.c 2008-01-24 10:44:51 UTC (rev 872) @@ -286,38 +286,38 @@ tcp_frame[1] = SS_DEFAULT; tcp_frame[2] = DATA_TP_RSP; tcp_frame[3] = SUBDATA_TP_STATUS; - - if ((left_led < 0x20) && (tux_status.led.left.on) - && tux_status.led.mask == false) + if (!(tux_status.led.mask)) { - tux_status.led.left.on = false; - tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; - tcp_frame[5] = tux_status.led.left.on; - tcp_server_send_raw(tcp_frame); - } - else if (tux_status.led.left.on == false) - { - tux_status.led.left.on = true; - tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; - tcp_frame[5] = tux_status.led.left.on; - tcp_server_send_raw(tcp_frame); - } + if ((left_led <= 0x20) && (tux_status.led.left.on)) + { + tux_status.led.left.on = false; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } + else if ((left_led > 0x20) && !(tux_status.led.left.on)) + { + tux_status.led.left.on = true; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } - if ((right_led < 0x20) && (tux_status.led.right.on) - && tux_status.led.mask == false) - { - tux_status.led.right.on = false; - tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; - tcp_frame[5] = tux_status.led.right.on; - tcp_server_send_raw(tcp_frame); + if ((right_led <= 0x20) && (tux_status.led.right.on)) + { + tux_status.led.right.on = false; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } + else if ((right_led > 0x20) && !(tux_status.led.right.on)) + { + tux_status.led.right.on = true; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } } - else if (tux_status.led.right.on == false) - { - tux_status.led.right.on = true; - tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; - tcp_frame[5] = tux_status.led.right.on; - tcp_server_send_raw(tcp_frame); - } } /* TODO Add functions to get the average battery voltage and status */ static void battery_changed(unsigned int const level, |