summaryrefslogtreecommitdiff
path: root/digital/beacon/src
diff options
context:
space:
mode:
authorFlorent Duchon2012-05-16 17:00:33 +0200
committerFlorent Duchon2012-05-16 17:43:08 +0200
commit57e774eee922780d6a584be72a8984d2a3711987 (patch)
treeb53046df090ea83b5e24ff6ccadd8e89a903ccb7 /digital/beacon/src
parent0e853d3c6fe3a1701ca977dfa0f155e87b93a66c (diff)
digital/beacon: broadcast reset API
Diffstat (limited to 'digital/beacon/src')
-rw-r--r--digital/beacon/src/debug_avr.c3
-rw-r--r--digital/beacon/src/network.c3
-rw-r--r--digital/beacon/src/network.h3
3 files changed, 8 insertions, 1 deletions
diff --git a/digital/beacon/src/debug_avr.c b/digital/beacon/src/debug_avr.c
index a3eec0f3..c99286aa 100644
--- a/digital/beacon/src/debug_avr.c
+++ b/digital/beacon/src/debug_avr.c
@@ -137,6 +137,9 @@ void usartRXCallback(uint16_t bytesToRead)
case 'j':
jack_on_off();
break;
+ case '0':
+ network_send_data(NETWORK_RESET,0x1);
+ break;
/* Default */
default :
uprintf(" ?? Unknown command ??\r\n");
diff --git a/digital/beacon/src/network.c b/digital/beacon/src/network.c
index fe413314..51cb1ea2 100644
--- a/digital/beacon/src/network.c
+++ b/digital/beacon/src/network.c
@@ -299,6 +299,9 @@ void APS_DataIndication(APS_DataInd_t* indData)
/* New angle is avaiiable, update position */
// update_position(appMessage->data[NETWORK_MSG_ADDR_FIELD],appMessage->data[NETWORK_MSG_DATA_FIELD]);
break;
+ case NETWORK_RESET:
+ reset_avr();
+ break;
default:
uprintf("Unknown data type received = %x\r\n",appMessage->data[NETWORK_MSG_TYPE_FIELD]);
break;
diff --git a/digital/beacon/src/network.h b/digital/beacon/src/network.h
index 88c875f2..a29a24d2 100644
--- a/digital/beacon/src/network.h
+++ b/digital/beacon/src/network.h
@@ -47,7 +47,8 @@ typedef enum
{
NETWORK_JACK_STATE,
NETWORK_OPPONENT_NUMBER,
- NETWORK_ANGLE_RAW
+ NETWORK_ANGLE_RAW,
+ NETWORK_RESET
} TMessage_type;