Added serial to the CD32/C= adapter.
This commit is contained in:
parent
997e261aab
commit
37ad902f36
|
@ -23,6 +23,10 @@
|
||||||
|
|
||||||
#include "Gamepad.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 = "CD32/C= to USB";
|
||||||
|
|
||||||
#define BUTTON_READ_DELAY 100 // Button read delay in µs
|
#define BUTTON_READ_DELAY 100 // Button read delay in µs
|
||||||
|
|
||||||
// Controller DB9 pins (looking face-on to the end of the plug):
|
// Controller DB9 pins (looking face-on to the end of the plug):
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Gamepad.h"
|
#include "Gamepad.h"
|
||||||
|
|
||||||
static const uint8_t _hidReportDescriptor[] PROGMEM = {
|
static const uint8_t _hidReportDescriptor[] PROGMEM = {
|
||||||
|
@ -146,5 +144,10 @@ void Gamepad_::send()
|
||||||
|
|
||||||
uint8_t Gamepad_::getShortName(char *name)
|
uint8_t Gamepad_::getShortName(char *name)
|
||||||
{
|
{
|
||||||
|
if(!next)
|
||||||
|
{
|
||||||
|
strcpy(name, gp_serial);
|
||||||
|
return strlen(name);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,7 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "HID.h"
|
#include "HID.h"
|
||||||
|
|
||||||
// NOTE: To make this work on the MiSTer (or possibly other Linux distros),
|
extern const char* gp_serial;
|
||||||
// you need to edit USBDesc.h like follows. Change:
|
|
||||||
// #define ISERIAL 3
|
|
||||||
// to
|
|
||||||
// #define ISERIAL 0
|
|
||||||
|
|
||||||
// The numbers after colon are bit fields, meaning how many bits the field uses.
|
// The numbers after colon are bit fields, meaning how many bits the field uses.
|
||||||
// Remove those if there are problems
|
// Remove those if there are problems
|
||||||
|
|
Loading…
Reference in New Issue