Serial added to SEGA adapters

This commit is contained in:
MickGyver 2020-04-25 17:40:25 +03:00
parent 4863d43b47
commit e7dcc5a735
6 changed files with 22 additions and 0 deletions

View File

@ -146,5 +146,10 @@ void Gamepad_::send()
uint8_t Gamepad_::getShortName(char *name)
{
if(!next)
{
strcpy(name, gp_serial);
return strlen(name);
}
return 0;
}

View File

@ -29,6 +29,8 @@
#include <Arduino.h>
#include "HID.h"
extern const char* gp_serial;
// The numbers after colon are bit fields, meaning how many bits the field uses.
// Remove those if there are problems
typedef struct {

View File

@ -24,6 +24,10 @@
#include "SegaController32U4.h"
#include "Gamepad.h"
// ATT: 20 chars max (including NULL at the end) according to Arduino source code.
// Additionally serial number is used to differentiate arduino projects to have different button maps!
const char *gp_serial = "Sega/C= to USB";
// Controller DB9 pins (looking face-on to the end of the plug):
//
// 5 4 3 2 1

View File

@ -146,5 +146,10 @@ void Gamepad_::send()
uint8_t Gamepad_::getShortName(char *name)
{
if(!next)
{
strcpy(name, gp_serial);
return strlen(name);
}
return 0;
}

View File

@ -29,6 +29,8 @@
#include <Arduino.h>
#include "HID.h"
extern const char* gp_serial;
// The numbers after colon are bit fields, meaning how many bits the field uses.
// Remove those if there are problems
typedef struct {

View File

@ -24,6 +24,10 @@
#include "SegaControllers32U4.h"
#include "Gamepad.h"
// ATT: 20 chars max (including NULL at the end) according to Arduino source code.
// Additionally serial number is used to differentiate arduino projects to have different button maps!
const char *gp_serial = "Sega/C= to USB";
// Controller DB9 pins (looking face-on to the end of the plug):
//
// 5 4 3 2 1