Fix bug in gamecube impl

This commit is contained in:
Travis Burtrum 2020-12-22 02:06:49 -05:00
parent 849a3e6941
commit c28734e7b1
1 changed files with 13 additions and 1 deletions

View File

@ -24,12 +24,23 @@ PIN # USAGE
//#define DEBUG
#ifdef GAMECUBE
/*
// these are my average values from my apparantly very bad wavebird controller
#define AXIS_CENTER_IN 135
#define AXIS_MAX_IN 230
#define AXIS_MIN_IN 30
#define TRIGGER_MAX_IN 236
#define TRIGGER_MIN_IN 36
*/
// these look like much more proper values from a pelican gc controller
#define AXIS_CENTER_IN 128
#define AXIS_MAX_IN 255
#define AXIS_MIN_IN 0
#define TRIGGER_MAX_IN 255
#define TRIGGER_MIN_IN 0
#else // N64
#define AXIS_CENTER_IN 0
@ -43,15 +54,16 @@ PIN # USAGE
#ifdef GAMECUBE
typedef CGamecubeController NintendoController;
typedef Gamecube_Report_t ControllerReport;
#define NINTENDO_REPORT_SIZE 8
#else // N64
typedef CN64Controller NintendoController;
typedef N64_Report_t ControllerReport;
#define NINTENDO_REPORT_SIZE 4
#endif
// Define a Controller
NintendoController controller(DATA_PIN);
#define NINTENDO_REPORT_SIZE 4
uint8_t oldReport[NINTENDO_REPORT_SIZE];
GAMEPAD_CLASS gamepad;