summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spillaz <smspillaz@gmail.com>2008-04-26 20:50:47 +0800
committerSam Spillaz <smspillaz@gmail.com>2008-04-26 20:50:47 +0800
commitfb03a2afe5da50ce82f7075b34f03b2ddbc412c2 (patch)
tree9bf49e4f1029784c674e917f6c9b0008e03f425d
parente8d1840c19de93f081df99b13df0bd10781e636f (diff)
downloadwiimote-fb03a2afe5da50ce82f7075b34f03b2ddbc412c2.tar.gz
wiimote-fb03a2afe5da50ce82f7075b34f03b2ddbc412c2.tar.bz2
* Part 2: Finish splitting util functions
-rw-r--r--wiimote.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/wiimote.c b/wiimote.c
index 0416119..441f608 100644
--- a/wiimote.c
+++ b/wiimote.c
@@ -37,94 +37,6 @@
static int corePrivateIndex;
-/* Utility Functions --------------------------------------------------- */
-
-/* Error Handling */
-void err(cwiid_wiimote_t *wiimote, const char *s, va_list ap)
-{
- if (wiimote) printf("%d:", cwiid_get_id(wiimote));
- else printf("-1:");
- vprintf(s, ap);
- printf("\n");
-}
-
-/* Set LED Wrapper */
-void set_led_state(cwiid_wiimote_t *wiimote, unsigned char led_state)
-{
- if (cwiid_set_led(wiimote, led_state)) {
- fprintf(stderr, "Error setting LEDs \n");
- }
-}
-
-/* Set Reporting Mode Wrapper*/
-void set_rpt_mode(cwiid_wiimote_t *wiimote, unsigned char rpt_mode)
-{
- if (cwiid_set_rpt_mode(wiimote, rpt_mode)) {
- fprintf(stderr, "Error setting report mode\n");
- }
-}
-
-/* Wii Remote Light Show */
-
-Bool wiimoteChangeLights(void *Wiimote)
-{
- cwiid_wiimote_t *wiimote = Wiimote;
- WIIMOTE_DISPLAY (firstDisplay);
- int led_state = 0;
- ad->count++;
- switch (ad->count)
- {
- case 1:
- {
- toggle_bit(led_state, CWIID_LED1_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 2:
- {
- toggle_bit(led_state, CWIID_LED2_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 3:
- {
- toggle_bit(led_state, CWIID_LED3_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 4:
- {
- toggle_bit(led_state, CWIID_LED4_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 5:
- {
- toggle_bit(led_state, CWIID_LED3_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 6:
- {
- toggle_bit(led_state, CWIID_LED2_ON);
- set_led_state(wiimote, led_state);
- }
- break;
- case 7:
- {
- toggle_bit(led_state, CWIID_LED1_ON);
- set_led_state(wiimote, led_state);
- ad->count = 1;
- }
- break;
- }
-
-
- return TRUE;
-}
-
-
-
/* Prototype cwiid_callback with cwiid_callback_t, define it with the actual
* type - this will cause a compile error (rather than some undefined bizarre
* behavior) if cwiid_callback_t changes */