Added serial to the CD32/C= adapter.

This commit is contained in:
MickGyver 2020-05-11 07:50:48 +03:00
parent 997e261aab
commit 37ad902f36
3 changed files with 10 additions and 7 deletions

View File

@ -23,6 +23,10 @@
#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 = "CD32/C= to USB";
#define BUTTON_READ_DELAY 100 // Button read delay in µs
// Controller DB9 pins (looking face-on to the end of the plug):

View File

@ -24,8 +24,6 @@
*
*/
#pragma once
#include "Gamepad.h"
static const uint8_t _hidReportDescriptor[] PROGMEM = {
@ -146,5 +144,10 @@ void Gamepad_::send()
uint8_t Gamepad_::getShortName(char *name)
{
if(!next)
{
strcpy(name, gp_serial);
return strlen(name);
}
return 0;
}

View File

@ -29,11 +29,7 @@
#include <Arduino.h>
#include "HID.h"
// NOTE: To make this work on the MiSTer (or possibly other Linux distros),
// you need to edit USBDesc.h like follows. Change:
// #define ISERIAL 3
// to
// #define ISERIAL 0
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