I'm stupid...
This commit is contained in:
parent
090699da8d
commit
b0db954831
|
@ -22,11 +22,11 @@ typedef struct button_def_t {
|
||||||
|
|
||||||
extern const button_def_t BUTTONS_DEFS[];
|
extern const button_def_t BUTTONS_DEFS[];
|
||||||
|
|
||||||
#define JOYSTICK_X_AXIS_PIN 28
|
#define JOYSTICK_X_AXIS_PIN 27
|
||||||
#define JOYSTICK_Y_AXIS_PIN 27
|
#define JOYSTICK_Y_AXIS_PIN 28
|
||||||
|
|
||||||
#define JOYSTICK_X_AXIS_ADC_INPUT 2
|
#define JOYSTICK_X_AXIS_ADC_INPUT 1
|
||||||
#define JOYSTICK_Y_AXIS_ADC_INPUT 1
|
#define JOYSTICK_Y_AXIS_ADC_INPUT 2
|
||||||
|
|
||||||
typedef struct inputs_buffer_t {
|
typedef struct inputs_buffer_t {
|
||||||
int8_t x_axis_speed;
|
int8_t x_axis_speed;
|
||||||
|
|
|
@ -25,7 +25,7 @@ void inputs_init(void)
|
||||||
const button_def_t *BUTTON_DEF = &BUTTONS_DEFS[actual_button];
|
const button_def_t *BUTTON_DEF = &BUTTONS_DEFS[actual_button];
|
||||||
|
|
||||||
gpio_init(BUTTON_DEF->pin);
|
gpio_init(BUTTON_DEF->pin);
|
||||||
gpio_set_dir(BUTTON_DEF->pin, GPIO_OUT);
|
gpio_set_dir(BUTTON_DEF->pin, GPIO_IN);
|
||||||
gpio_pull_up(BUTTON_DEF->pin);
|
gpio_pull_up(BUTTON_DEF->pin);
|
||||||
|
|
||||||
controller.inputs_buffer.buttons_states[actual_button] = 0;
|
controller.inputs_buffer.buttons_states[actual_button] = 0;
|
||||||
|
|
Loading…
Reference in New Issue