[tuxdroid-svn] r256 - svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment va
Status: Beta
Brought to you by:
ks156
From: svnlook:warning@affinitic.be:cannot s. L. l. <c2m...@c2...> - 2007-04-14 15:20:18
|
Author: svnlook: warning: cannot set LC_CTYPE locale Date: svnlook: warning: environment variable LANG is EN New Revision: 256 Modified: daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h Log: neimad 2007-04-14 17:20:14 +0200 (Sat, 14 Apr 2007) 112 * Made USBDaemon_status_table.[ch] coding style compliant and spaced things out a bit to improve readability. svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment variable LANG is EN svnlook: warning: please check that your locale name is correct Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-04-14 15:00:15 UTC (rev 255) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-04-14 15:20:14 UTC (rev 256) @@ -25,6 +25,7 @@ #include "USBDaemon_globals.h" #include "USBDaemon_tcp_server.h" #include "../tuxdefs/commands.h" + /*_____________________ V A R I A B L E S __________________________________*/ _PORT_BYTE_ portb; _PORT_BYTE_ portc; @@ -46,6 +47,7 @@ unsigned char last_toggle_key = 0xFF;; unsigned char sound_flash_count = 0; unsigned char current_audio_channel = 0; + /*_____________________ F U N C T I O N S __________________________________*/ /************************************************************************ */ @@ -53,47 +55,69 @@ /************************************************************************ */ void update_raw_status_table(unsigned char new_status[TUX_RECV_LENGTH]) { - switch(new_status[0]) + switch (new_status[0]) { case STATUS_PORTS_CMD: - if(portb.Byte != new_status[1]) portb_changed(new_status[1]); - if(portc.Byte != new_status[2]) portc_changed(new_status[2]); - if(portd.Byte != new_status[3]) portd_changed(new_status[3]); + if (portb.Byte != new_status[1]) + portb_changed(new_status[1]); + if (portc.Byte != new_status[2]) + portc_changed(new_status[2]); + if (portd.Byte != new_status[3]) + portd_changed(new_status[3]); break; + case STATUS_SENSORS1_CMD: - if(sensors1.Byte != new_status[1]) sensors1_changed(new_status[1]); + if (sensors1.Byte != new_status[1]) + sensors1_changed(new_status[1]); break; + case STATUS_LIGHT_CMD: - if((sensors2.level_light_high.Byte != new_status[1]) || (sensors2.level_light_low.Byte != new_status[2]) ) sensors2_changed(new_status[1], new_status[2], new_status[3]); + if (sensors2.level_light_high.Byte != new_status[1] + || sensors2.level_light_low.Byte != new_status[2]) + sensors2_changed(new_status[1], new_status[2], new_status[3]); break; + case STATUS_POSITION1_CMD: - if((position1.eyes_position.Byte != new_status[1])||(position1.mouth_position.Byte != new_status[2])||(position1.wings_position.Byte != new_status[3])) position1_changed(new_status[1], new_status[2], new_status[3]); + if (position1.eyes_position.Byte != new_status[1] + || position1.mouth_position.Byte != new_status[2] + || position1.wings_position.Byte != new_status[3]) + position1_changed(new_status[1], new_status[2], new_status[3]); break; + case STATUS_POSITION2_CMD: - if(position2.Byte != new_status[1]) position2_changed(new_status[1]); + if (position2.Byte != new_status[1]) + position2_changed(new_status[1]); break; + case PONG_CMD: pong_received++; pong_event(new_status[1], pong_received); break; + case VERSION_CMD: update_version_table(new_status); break; + case REVISION_CMD: update_revision_table(new_status); break; + case AUTHOR_CMD: update_author_table(new_status); break; + case SOUND_VAR_CMD: update_sound_flash_count(new_status); break; + case STATUS_IR_CMD: update_ir(new_status); break; + default: if (show_invalid_raw) - printf("%.2x %.2x %.2x %.2x\n", new_status[0], new_status[1], new_status[2], new_status[3]); + printf("%.2x %.2x %.2x %.2x\n", new_status[0], new_status[1], + new_status[2], new_status[3]); break; } } @@ -115,21 +139,24 @@ tcp_frame[3] = SUBDATA_TP_STATUS; DONGLE_status = new_status[0]; + /*RF status change */ - if(RF_status != new_status[1]) + if (RF_status != new_status[1]) { RF_status = new_status[1]; tcp_frame[4] = DATA_STATUS_RF_CONNECTED; tcp_frame[5] = RF_status; tcp_server_send_raw(tcp_frame); } + /* Command status change */ - if(CMD_status != new_status[2]) + if (CMD_status != new_status[2]) { CMD_status = new_status[2]; - if((CMD_status == 2)||(CMD_status == 3)) + if (CMD_status == 2 || CMD_status == 3) cmd_status_flag = 0; } + NUMBER_frames = new_status[3]; } @@ -199,12 +226,11 @@ code = new_status[1] & 0x3F; toggle = new_status[1] & 0x40; check = new_status[1] & 0x80; - if(last_remote_key == code) + + if (last_remote_key == code) { - if(last_toggle_key == toggle) - { + if (last_toggle_key == toggle) new_code = 0; - } else { last_remote_key = code; @@ -218,7 +244,8 @@ last_toggle_key = toggle; new_code = 1; } - if(new_code) + + if (new_code) { printf("Remote code : %.2x\n", code); @@ -275,7 +302,7 @@ tcp_frame[3] = SUBDATA_TP_STATUS; /* wings motor backward */ - if((portb.Byte & 0x01) != (new_value & 0x01)) + if ((portb.Byte & 0x01) != (new_value & 0x01)) { tcp_frame[4] = DATA_STATUS_WINGS_MOTOR_BACKWARD; if (portb.bits.PB0) @@ -290,8 +317,9 @@ } tcp_server_send_raw(tcp_frame); } + /* spin motor backward */ - if((portb.Byte & 0x02) != (new_value & 0x02)) + if ((portb.Byte & 0x02) != (new_value & 0x02)) { tcp_frame[4] = DATA_STATUS_SPIN_MOTOR_BACKWARD; if (portb.bits.PB1) @@ -306,8 +334,9 @@ } tcp_server_send_raw(tcp_frame); } + /* spin motor forward */ - if((portb.Byte & 0x04) != (new_value & 0x04)) + if ((portb.Byte & 0x04) != (new_value & 0x04)) { tcp_frame[4] = DATA_STATUS_SPIN_MOTOR_FORWARD; if (portb.bits.PB2) @@ -322,10 +351,11 @@ } tcp_server_send_raw(tcp_frame); } + /* mouth open position motor */ - if((portb.Byte & 0x08) != (new_value & 0x08)) + if ((portb.Byte & 0x08) != (new_value & 0x08)) { - tcp_frame[4] = DATA_STATUS_MOUTH_OPEN_POSITION ; + tcp_frame[4] = DATA_STATUS_MOUTH_OPEN_POSITION; if (portb.bits.PB3) { /* Up */ @@ -340,8 +370,9 @@ } tcp_server_send_raw(tcp_frame); } + /* mouth close position motor */ - if((portb.Byte & 0x10) != (new_value & 0x10)) + if ((portb.Byte & 0x10) != (new_value & 0x10)) { tcp_frame[4] = DATA_STATUS_MOUTH_CLOSED_POSITION; if (portb.bits.PB4) @@ -356,10 +387,11 @@ } tcp_server_send_raw(tcp_frame); } + /* charger inhibit signal */ - if((portb.Byte & 0x40) != (new_value & 0x40)) + if ((portb.Byte & 0x40) != (new_value & 0x40)) { - tcp_frame[4] = DATA_STATUS_CHARGER_INHIBIT_SIGNAL ; + tcp_frame[4] = DATA_STATUS_CHARGER_INHIBIT_SIGNAL; if (portb.bits.PB6) { printf("charger inhibit signal 0\n"); @@ -372,6 +404,7 @@ } tcp_server_send_raw(tcp_frame); } + portb.Byte = new_value; } @@ -392,7 +425,7 @@ tcp_frame[3] = SUBDATA_TP_STATUS; /* wings position switch */ - if((portc.Byte & 0x02) != (new_value & 0x02)) + if ((portc.Byte & 0x02) != (new_value & 0x02)) { tcp_frame[4] = DATA_STATUS_WINGS_POSITION_SWITCH; if (portc.bits.PB1) @@ -407,8 +440,9 @@ } tcp_server_send_raw(tcp_frame); } + /* right blue led */ - if((portc.Byte & 0x04) != (new_value & 0x04)) + if ((portc.Byte & 0x04) != (new_value & 0x04)) { tcp_frame[4] = DATA_STATUS_RIGHT_BLUE_LED; if (portc.bits.PB2) @@ -423,8 +457,9 @@ } tcp_server_send_raw(tcp_frame); } + /* left blue led */ - if((portc.Byte & 0x08) != (new_value & 0x08)) + if ((portc.Byte & 0x08) != (new_value & 0x08)) { tcp_frame[4] = DATA_STATUS_LEFT_BLUE_LED; if (portc.bits.PB3) @@ -439,6 +474,7 @@ } tcp_server_send_raw(tcp_frame); } + portc.Byte = new_value; } @@ -459,7 +495,7 @@ tcp_frame[3] = SUBDATA_TP_STATUS; /* head motor for eyes */ - if((portd.Byte & 0x01) != (new_value & 0x01)) + if ((portd.Byte & 0x01) != (new_value & 0x01)) { tcp_frame[4] = DATA_STATUS_HEAD_MOTOR_FOR_EYES; if (portd.bits.PB0) @@ -474,8 +510,9 @@ } tcp_server_send_raw(tcp_frame); } + /* head motor for mouth */ - if((portd.Byte & 0x02) != (new_value & 0x02)) + if ((portd.Byte & 0x02) != (new_value & 0x02)) { tcp_frame[4] = DATA_STATUS_HEAD_MOTOR_FOR_MOUTH; if (portd.bits.PB1) @@ -490,8 +527,9 @@ } tcp_server_send_raw(tcp_frame); } + /* spin position switch */ - if((portd.Byte & 0x08) != (new_value & 0x08)) + if ((portd.Byte & 0x08) != (new_value & 0x08)) { tcp_frame[4] = DATA_STATUS_SPIN_POSITION_SWITCH; if (portd.bits.PB3) @@ -506,8 +544,9 @@ } tcp_server_send_raw(tcp_frame); } + /* wings motor forward */ - if((portd.Byte & 0x10) != (new_value & 0x10)) + if ((portd.Byte & 0x10) != (new_value & 0x10)) { tcp_frame[4] = DATA_STATUS_WINGS_MOTOR_FORWARD; if (portd.bits.PB4) @@ -522,8 +561,9 @@ } tcp_server_send_raw(tcp_frame); } + /* IR led */ - if((portd.Byte & 0x20) != (new_value & 0x20)) + if ((portd.Byte & 0x20) != (new_value & 0x20)) { tcp_frame[4] = DATA_STATUS_IR_LED; if (portd.bits.PB5) @@ -538,8 +578,9 @@ } tcp_server_send_raw(tcp_frame); } + /* eyes open position switch */ - if((portd.Byte & 0x40) != (new_value & 0x40)) + if ((portd.Byte & 0x40) != (new_value & 0x40)) { tcp_frame[4] = DATA_STATUS_EYES_OPEN_POSITION_SWITCH; if (portd.bits.PB6) @@ -554,6 +595,7 @@ } tcp_server_send_raw(tcp_frame); } + /* eyes closed position switch */ if((portd.Byte & 0x80) != (new_value & 0x80)) { @@ -570,6 +612,7 @@ } tcp_server_send_raw(tcp_frame); } + portd.Byte = new_value; } @@ -590,7 +633,7 @@ tcp_frame[3] = SUBDATA_TP_STATUS; /* Left wing push */ - if((sensors1.Byte & 0x01) != (new_value & 0x01)) + if ((sensors1.Byte & 0x01) != (new_value & 0x01)) { tcp_frame[4] = DATA_STATUS_LEFT_WING_PUSH; if (sensors1.bits.PB0) @@ -605,8 +648,9 @@ } tcp_server_send_raw(tcp_frame); } + /* Right wing push */ - if((sensors1.Byte & 0x02) != (new_value & 0x02)) + if ((sensors1.Byte & 0x02) != (new_value & 0x02)) { tcp_frame[4] = DATA_STATUS_RIGHT_WING_PUSH; if (sensors1.bits.PB1) @@ -621,8 +665,9 @@ } tcp_server_send_raw(tcp_frame); } + /* power plug insertion switch */ - if((sensors1.Byte & 0x04) != (new_value & 0x04)) + if ((sensors1.Byte & 0x04) != (new_value & 0x04)) { tcp_frame[4] = DATA_STATUS_POWER_PLUG_SWITCH; if (sensors1.bits.PB2) @@ -637,8 +682,9 @@ } tcp_server_send_raw(tcp_frame); } + /* Head push */ - if((sensors1.Byte & 0x08) != (new_value & 0x08)) + if ((sensors1.Byte & 0x08) != (new_value & 0x08)) { tcp_frame[4] = DATA_STATUS_HEAD_PUSH_SWITCH; if (sensors1.bits.PB3) @@ -653,8 +699,9 @@ } tcp_server_send_raw(tcp_frame); } + /* Led charger */ - if((sensors1.Byte & 0x10) != (new_value & 0x10)) + if ((sensors1.Byte & 0x10) != (new_value & 0x10)) { tcp_frame[4] = DATA_STATUS_CHARGER_LED_STATUS; if (sensors1.bits.PB4) @@ -669,8 +716,9 @@ } tcp_server_send_raw(tcp_frame); } + /* mute status */ - if((sensors1.Byte & 0x80) != (new_value & 0x80)) + if ((sensors1.Byte & 0x80) != (new_value & 0x80)) { tcp_frame[4] = DATA_STATUS_MUTE_STATUS; if (sensors1.bits.PB7) @@ -685,16 +733,15 @@ } tcp_server_send_raw(tcp_frame); } + sensors1.Byte = new_value; } /************************************************************************ */ /* sensors2_changed() */ /************************************************************************ */ -void sensors2_changed( - unsigned char new_value_high, - unsigned char new_value_low, - unsigned char new_light_mode) +void sensors2_changed(unsigned char new_value_high, unsigned char new_value_low, + unsigned char new_light_mode) { tcp_frame_t tcp_frame; unsigned char i; @@ -720,10 +767,9 @@ /************************************************************************ */ /* position1_changed() */ /************************************************************************ */ -void position1_changed( - unsigned char eyes_position, - unsigned char mouth_position, - unsigned char wings_position) +void position1_changed(unsigned char eyes_position, + unsigned char mouth_position, + unsigned char wings_position) { tcp_frame_t tcp_frame; unsigned char i; @@ -736,21 +782,23 @@ tcp_frame[2] = DATA_TP_RSP; tcp_frame[3] = SUBDATA_TP_STATUS; - if(position1.eyes_position.Byte != eyes_position) + if (position1.eyes_position.Byte != eyes_position) { position1.eyes_position.Byte = eyes_position; tcp_frame[4] = DATA_STATUS_EYES_POSITION_COUNTER; tcp_frame[5] = eyes_position; tcp_server_send_raw(tcp_frame); } - if(position1.mouth_position.Byte != mouth_position) + + if (position1.mouth_position.Byte != mouth_position) { position1.mouth_position.Byte = mouth_position; tcp_frame[4] = DATA_STATUS_MOUTH_POSITION_COUNTER; tcp_frame[5] = mouth_position; tcp_server_send_raw(tcp_frame); } - if(position1.wings_position.Byte != wings_position) + + if (position1.wings_position.Byte != wings_position) { position1.wings_position.Byte = wings_position; tcp_frame[4] = DATA_STATUS_WINGS_POSITION_COUNTER; Modified: daemon/trunk/libs/USBDaemon_status_table.h =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.h 2007-04-14 15:00:15 UTC (rev 255) +++ daemon/trunk/libs/USBDaemon_status_table.h 2007-04-14 15:20:14 UTC (rev 256) @@ -210,19 +210,32 @@ extern author_t hw_author[4]; extern unsigned char sound_flash_count; extern unsigned char current_audio_channel; + /*_____________________ F U N C T I O N S __________________________________*/ extern void update_raw_status_table(unsigned char new_status[]); extern void update_system_status_table(unsigned char new_status[]); + extern void update_version_table(unsigned char new_status[4]); extern void update_revision_table(unsigned char new_status[4]); + extern void update_author_table(unsigned char new_status[4]); + extern void update_sound_flash_count(unsigned char new_status[4]); + extern void update_ir(unsigned char new_status[4]); + extern void pong_event(unsigned char pong_number, unsigned char pong_received); + extern void portb_changed(unsigned char new_value); extern void portc_changed(unsigned char new_value); extern void portd_changed(unsigned char new_value); + extern void sensors1_changed(unsigned char new_value); -extern void sensors2_changed(unsigned char new_value_high, unsigned char new_value_low, unsigned char new_light_mode); -extern void position1_changed(unsigned char eyes_position, unsigned char mouth_position, unsigned char wings_position); +extern void sensors2_changed(unsigned char new_value_high, + unsigned char new_value_low, + unsigned char new_light_mode); + +extern void position1_changed(unsigned char eyes_position, + unsigned char mouth_position, + unsigned char wings_position); extern void position2_changed(unsigned char new_value); |