Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Repo_Noeud_Mobile by
Diff: main.cpp
- Revision:
- 44:0862bc49ffa7
- Parent:
- 43:92c9e58b8a3a
- Child:
- 46:5fdd45fef08d
--- a/main.cpp Wed Apr 08 14:10:12 2015 +0000 +++ b/main.cpp Wed Apr 08 19:38:12 2015 +0000 @@ -42,7 +42,7 @@ Accel accel; flex_t flex_data; RtosTimer *sync; -GameMode_e mode = RPS; +GameMode_e mode = WAITING; short PanId; Xbee xbee; @@ -125,6 +125,19 @@ flexSensors.Run(); } +void GetGameMode(void const* args) { + while (true) { + // attente et lecture d'un événement digital + osEvent evtD = xbee.mailbox_TypeDeJeu.get(); + if (evtD.status == osEventMail) { + Fixe_Vers_Mobile *mail = (Fixe_Vers_Mobile*)evtD.value.p; + mode = mail->game; + // Envoyer la structure + xbee.mailbox_TypeDeJeu.free(mail); + } + } +} + void gunner(void const* args) {