Author: remi
Date: 2008-07-01 10:20:59 +0200 (Tue, 01 Jul 2008)
New Revision: 1288
Modified:
software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c
software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h
Log:
* added the motor statuses in the low level structures and in the low level
statuses parsing.
Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c
===================================================================
--- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c
2008-07-01 07:51:25 UTC (rev 1287)
+++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c
2008-07-01 08:20:59 UTC (rev 1288)
@@ -334,9 +334,14 @@
{
ret = FRAME_HEADER_POSITION2;
}
+ if (hw_status_table.position2.motors.Byte != frame[3])
+ {
+ ret = FRAME_HEADER_POSITION2;
+ }
hw_status_table.position2.spin_remaining_mvm = frame[1];
hw_status_table.position2.wings_down = frame[2];
+ hw_status_table.position2.motors.Byte = frame[3];
return ret;
}
Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h
===================================================================
--- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h
2008-07-01 07:51:25 UTC (rev 1287)
+++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h
2008-07-01 08:20:59 UTC (rev 1288)
@@ -204,6 +204,22 @@
typedef struct
{
+ _BIT_ spin_left_on:1;
+ _BIT_ spin_right_on:1;
+ _BIT_ eyes_on:1;
+ _BIT_ mouth_on:1;
+ _BIT_ flippers_on:1;
+ _BIT_ ndef:3;
+} _MOTORS_STATUS_BITS_;
+
+typedef union
+{
+ unsigned char Byte;
+ _MOTORS_STATUS_BITS_ bits;
+} _MOTORS_STATUS_BYTE_;
+
+typedef struct
+{
_PORTB_BYTE_ portb;
_PORTC_BYTE_ portc;
_PORTD_BYTE_ portd;
@@ -232,9 +248,9 @@
typedef struct
{
- unsigned char spin_remaining_mvm;
- unsigned char wings_down;
- /*unsigned char ??; NDEF */
+ unsigned char spin_remaining_mvm;
+ unsigned char wings_down;
+ _MOTORS_STATUS_BYTE_ motors;
} frame_body_position2_t;
typedef struct
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn