summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon/src/twi_specific.c
diff options
context:
space:
mode:
authorFlorent Duchon2013-03-28 22:15:41 +0100
committerFlorent Duchon2013-03-28 23:07:35 +0100
commitfb5fc876169d9f9963e9d07d1b5d573a28320866 (patch)
treed0e279dc6c5c6c7857ae0e93b3af3310036e00af /digital/beacon/src/twi_specific.c
parent894e8307503e67088b114cbbe644f58c7c2aa089 (diff)
digital/beacon: add API to compute my robot position from xy
Diffstat (limited to 'digital/beacon/src/twi_specific.c')
-rw-r--r--digital/beacon/src/twi_specific.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/digital/beacon/src/twi_specific.c b/digital/beacon/src/twi_specific.c
index 9bd35f5e..7e349d16 100644
--- a/digital/beacon/src/twi_specific.c
+++ b/digital/beacon/src/twi_specific.c
@@ -34,6 +34,7 @@
static HAL_AppTimer_t twiTimer;
+extern robot_s my_robot;
/* This function manages the TWI RX/RX transferts */
void twi_task(void)
@@ -76,8 +77,11 @@ void twi_task(void)
jack_update_status(RXbuffer[TWI_RX_JACK_FIELD]);
if(RXbuffer[TWI_RX_JACK_FIELD] == 1)
{
+ /* Get color value from IA and save it*/
color_set_value(RXbuffer[TWI_RX_COLOR_FIELD]);
- formula_update_apb_position((RXbuffer[TWI_RX_X_MSB_FIELD]<<8)+RXbuffer[TWI_RX_X_LSB_FIELD],(RXbuffer[TWI_RX_Y_MSB_FIELD]<<8)+RXbuffer[TWI_RX_Y_LSB_FIELD]);
+
+ /* Update my robot structure with xy from IA */
+ formula_update_robot_from_xy(&my_robot,(RXbuffer[TWI_RX_X_MSB_FIELD]<<8)+RXbuffer[TWI_RX_X_LSB_FIELD],(RXbuffer[TWI_RX_Y_MSB_FIELD]<<8)+RXbuffer[TWI_RX_Y_LSB_FIELD]);
}
}
else
@@ -87,6 +91,7 @@ void twi_task(void)
}
}
+
/* Initialisze specific TWI */
void twi_init_specific(void)
{