change MAX_BUTTONS to JOY_MAX_BUTTONS