Definition in file s_joystick.h.
#include "compiler.h"
Go to the source code of this file.
Functions | |
Bool | b_joystick_get_value (char *buf) |
Get the current joystick state. |
Bool b_joystick_get_value | ( | char * | buf | ) |
Get the current joystick state.
buf | char buffer in which the joystick state is stored. |
Definition at line 94 of file s_joystick.c.
References acpc_js_events, JS_EVENT_DOWN, JS_EVENT_LEFT, JS_EVENT_PUSH, JS_EVENT_RIGHT, JS_EVENT_UP, and x_joystick.
Referenced by device_full_custom_task().
00095 { 00096 // input is pulled up, if 1 : input is not active 00097 if ( !is_joystick_up() ) { Clr_bits(x_joystick, JS_EVENT_UP); } 00098 else { Set_bits(x_joystick, JS_EVENT_UP); } 00099 00100 if ( !is_joystick_down() ) { Clr_bits(x_joystick, JS_EVENT_DOWN); } 00101 else { Set_bits(x_joystick, JS_EVENT_DOWN); } 00102 00103 if ( !is_joystick_left() ) { Clr_bits(x_joystick, JS_EVENT_LEFT); } 00104 else { Set_bits(x_joystick, JS_EVENT_LEFT); } 00105 00106 if ( !is_joystick_right() ) { Clr_bits(x_joystick, JS_EVENT_RIGHT); } 00107 else { Set_bits(x_joystick, JS_EVENT_RIGHT); } 00108 00109 if ( !is_joystick_pressed() ) { Clr_bits(x_joystick, JS_EVENT_PUSH); } 00110 else { Set_bits(x_joystick, JS_EVENT_PUSH); } 00111 00112 // Build the log string. 00113 sprintf( buf, "%s\r\n", (portCHAR *)acpc_js_events[x_joystick]); 00114 return TRUE; 00115 }