summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--digital/beacon/src/twi_specific.c2
-rw-r--r--digital/beacon/src/twi_specific.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/digital/beacon/src/twi_specific.c b/digital/beacon/src/twi_specific.c
index 5def1a2b..30da73d9 100644
--- a/digital/beacon/src/twi_specific.c
+++ b/digital/beacon/src/twi_specific.c
@@ -62,7 +62,7 @@ void twi_task(void)
TXbuffer[TWI_TX_TRUST2_FIELD] = position_get_trust(OPPONENT_2);
/* Compute CRC */
- TXbuffer[TWI_TX_CRC_FIELD] = crc_compute (&TXbuffer[1], sizeof (TXbuffer) - 1);
+ TXbuffer[TWI_TX_CRC_FIELD] = crc_compute (&TXbuffer[1],TWI_TX_FIELD_NB-1);
/* data to be communicated to the master */
twi_slave_update (TXbuffer, sizeof (TXbuffer));
diff --git a/digital/beacon/src/twi_specific.h b/digital/beacon/src/twi_specific.h
index ee244cb7..76c6b42a 100644
--- a/digital/beacon/src/twi_specific.h
+++ b/digital/beacon/src/twi_specific.h
@@ -56,7 +56,8 @@ typedef enum
TWI_TX_X2_LSB_FIELD,
TWI_TX_Y2_MSB_FIELD,
TWI_TX_Y2_LSB_FIELD,
- TWI_TX_TRUST2_FIELD
+ TWI_TX_TRUST2_FIELD,
+ TWI_TX_FIELD_NB
} TTWI_TX_field;
/* This function manages the TWI RX/RX transferts */