Update readme, add horipad ids
This commit is contained in:
2
Firmware/RP2040/.vscode/settings.json
vendored
2
Firmware/RP2040/.vscode/settings.json
vendored
@@ -7,7 +7,7 @@
|
||||
"PICO_SDK_PATH": "C:/Programming/pico-sdk"
|
||||
},
|
||||
"cmake.configureArgs": [
|
||||
"-DOGXM_BOARD=W_ESP32",
|
||||
"-DOGXM_BOARD=PI_PICO",
|
||||
"-DMAX_GAMEPADS=1"
|
||||
],
|
||||
"files.associations": {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
namespace OGXMini {
|
||||
|
||||
Gamepad gamepads_[MAX_GAMEPADS];
|
||||
std::atomic<bool> tud_inited_{false};
|
||||
|
||||
void core1_task()
|
||||
{
|
||||
@@ -45,9 +44,11 @@ void core1_task()
|
||||
//Called by tusb host or i2c driver so we know to connect or disconnect usb
|
||||
void update_tud_status(bool host_mounted)
|
||||
{
|
||||
static bool tud_is_inited = false;
|
||||
|
||||
board_api::set_led(host_mounted);
|
||||
|
||||
if (!host_mounted && tud_inited_.load())
|
||||
if (!host_mounted && tud_is_inited)
|
||||
{
|
||||
TaskQueue::Core0::queue_task([]()
|
||||
{
|
||||
@@ -58,12 +59,12 @@ void update_tud_status(bool host_mounted)
|
||||
board_api::reboot();
|
||||
});
|
||||
}
|
||||
else if (!tud_inited_.load())
|
||||
else if (!tud_is_inited)
|
||||
{
|
||||
TaskQueue::Core0::queue_task([]()
|
||||
if (TaskQueue::Core0::queue_task([]() { tud_init(BOARD_TUD_RHPORT); }))
|
||||
{
|
||||
tud_init(BOARD_TUD_RHPORT);
|
||||
});
|
||||
tud_is_inited = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,8 +111,6 @@ void run_program()
|
||||
sleep_ms(100);
|
||||
}
|
||||
|
||||
tud_inited_.store(true);
|
||||
|
||||
while (true)
|
||||
{
|
||||
TaskQueue::Core0::process_tasks();
|
||||
|
||||
@@ -50,14 +50,16 @@ static const HardwareID PSCLASSIC_IDS[] =
|
||||
|
||||
static const HardwareID SWITCH_PRO_IDS[] =
|
||||
{
|
||||
{0x057E, 0x2009} // Switch Pro
|
||||
{0x057E, 0x2009}, // Switch Pro
|
||||
// {0x20D6, 0xA711}, // OpenSteamController, emulated pro controller
|
||||
};
|
||||
|
||||
static const HardwareID SWITCH_WIRED_IDS[] =
|
||||
{
|
||||
{0x20D6, 0xA719}, // PowerA wired
|
||||
{0x20D6, 0xA713}, // PowerA Enhanced wired
|
||||
{0x0F0D, 0x0092} // Hori Pokken wired, I don't have this one so not 100% on if it'll work
|
||||
{0x0F0D, 0x0092}, // Hori Pokken Tournament Pro
|
||||
{0x0F0D, 0x00C1}, // Hori Pokken Horipad
|
||||
};
|
||||
|
||||
static const HardwareID N64_IDS[] =
|
||||
|
||||
@@ -115,7 +115,7 @@ You can compile this for different boards with the CMake argument ```OGXM_BOARD`
|
||||
```PI_PICO``` ```RP_ZERO``` ```ADA_FEATHER``` ```PI_PICOW``` ```W_ESP32``` ```EXTERNAL_4CH```
|
||||
You can also set ```MAX_GAMEPADS``` which, if greater than one, will only support DInput (PS3) and Switch.
|
||||
|
||||
You'll need CMake, Ninja and the GCC ARM toolchain installed. Here's an example on Windows:
|
||||
You'll need git, python3, CMake, Ninja and the GCC ARM toolchain installed. CMake scripts will patch some files in Bluepad32 and BTStack, and also init the git submodules to make sure everything's there. Here's an example on Windows:
|
||||
```
|
||||
git clone --recursive https://github.com/wiredopposite/OGX-Mini.git
|
||||
cd OGX-Mini/Firmware/RP2040
|
||||
@@ -124,8 +124,6 @@ cmake --build build
|
||||
```
|
||||
Or just install the GCC ARM toolchain and use the CMake Tools extension in VSCode.
|
||||
|
||||
CMake scripts will patch some files in TinyUSB, Bluepad32 and BTStack. If the patches fail, it's because of a text encoding issue, so open each .diff file in ```OGX-Mini/Firmware/external/patches``` in Notepad++. At the top of the window, click Encoding > UTF-8 and save. They should work after that.
|
||||
|
||||
### ESP32
|
||||
Please see the Hardware directory for a schematic showing how to hookup the ESP32 to your RP2040.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user