diff --git a/example/example.c b/example/example.c index 8eca369..7d045ea 100644 --- a/example/example.c +++ b/example/example.c @@ -266,12 +266,12 @@ void handle_disconnect(wiimote* wm) { printf("\n\n--- DISCONNECTED [wiimote id %i] ---\n", wm->unid); } - -void test(struct wiimote_t* wm, byte* data, unsigned short len) { - printf("test: %i [%x %x %x %x]\n", len, data[0], data[1], data[2], data[3]); -} - - + +void test(struct wiimote_t* wm, byte* data, unsigned short len) { + printf("test: %i [%x %x %x %x]\n", len, data[0], data[1], data[2], data[3]); +} + + /** * @brief main() @@ -355,7 +355,7 @@ int main(int argc, char** argv) { * what LEDs are lit. */ //wiiuse_status(wiimotes[0]); - + /* * This is the main loop * @@ -364,7 +364,7 @@ int main(int argc, char** argv) { * (it doesn't matter if some of those wiimotes are not used * or are not connected). * - * This function will set the event flag for each wiimote + * This function will set the event flag for each wiimote * when the wiimote has things to report. */ while (1) { @@ -386,20 +386,20 @@ int main(int argc, char** argv) { handle_ctrl_status(wiimotes[i]); break; - case WIIUSE_DISCONNECT: + case WIIUSE_DISCONNECT: case WIIUSE_UNEXPECTED_DISCONNECT: /* the wiimote disconnected */ handle_disconnect(wiimotes[i]); break; - case WIIUSE_READ_DATA: - /* - * Data we requested to read was returned. - * Take a look at wiimotes[i]->read_req - * for the data. - */ - break; - + case WIIUSE_READ_DATA: + /* + * Data we requested to read was returned. + * Take a look at wiimotes[i]->read_req + * for the data. + */ + break; + case WIIUSE_NUNCHUK_INSERTED: /* * a nunchuk was inserted @@ -408,14 +408,14 @@ int main(int argc, char** argv) { * as the wiimote. */ //wiiuse_set_nunchuk_orient_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 90.0f); - //wiiuse_set_nunchuk_accel_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 100); - printf("Nunchuk inserted.\n"); - break; + //wiiuse_set_nunchuk_accel_threshold((struct nunchuk_t*)&wiimotes[i]->exp.nunchuk, 100); + printf("Nunchuk inserted.\n"); + break; + + case WIIUSE_CLASSIC_CTRL_INSERTED: + printf("Classic controller inserted.\n"); + break; - case WIIUSE_CLASSIC_CTRL_INSERTED: - printf("Classic controller inserted.\n"); - break; - case WIIUSE_WII_BOARD_CTRL_INSERTED: printf("Balance board controller inserted.\n"); break; @@ -423,8 +423,8 @@ int main(int argc, char** argv) { case WIIUSE_GUITAR_HERO_3_CTRL_INSERTED: /* some expansion was inserted */ handle_ctrl_status(wiimotes[i]); - printf("Guitar Hero 3 controller inserted.\n"); - break; + printf("Guitar Hero 3 controller inserted.\n"); + break; case WIIUSE_NUNCHUK_REMOVED: case WIIUSE_CLASSIC_CTRL_REMOVED: