Skip to content

Commit

Permalink
Merge pull request #3 from TeamOpenFIRE/PerspectiveSupport
Browse files Browse the repository at this point in the history
Switch from Prow's values to those for Perspective
  • Loading branch information
SeongGino authored Jun 6, 2024
2 parents 14606c3 + 7c8f6e5 commit 5eb5518
Show file tree
Hide file tree
Showing 10 changed files with 3,849 additions and 932 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
### Reference configuration utility for the [OpenFIRE light gun system](https://github.com/TeamOpenFIRE/OpenFIRE-Firmware), written in Qt & C++.

## Features:
- Cross-platform QT application, portable across desktops to Pis and other OSes.
- Simple to use: select the gun from the dropdown, and configure away!
- See and manage current pins layout, toggle on and off custom mappings, set other tunables, and change the gun's USB identifier (with built-in decimal-to-hex conversion for your convenience!).
- Also serves as a testing utility for button input and solenoid/rumble force feedback.
- **Cross-platform Qt application,** portable across Linux & Windows desktops & Raspberry Pi systems.
- **Simple to use:** select the gun from the dropdown, and configure away!
- See and manage current pins layout, toggle on and off custom mappings, set other tunables, and change the gun's USB identifier (with built-in decimal-to-hex conversion for your convenience!) all on the fly.
- Also serves as a testing utility for button input, solenoid/rumble force feedback, and camera.

## Running:
Boards flashed with OpenFIRE *must be plugged in **before** launching the application.* The app will notify if it can't find any compatible boards connected.

### For Linux:
##### Requirements: Anything with QT5 support.
- Arch Linux: TODO: Aur PKGBUILD when public
- Arch Linux: **TODO: Aur PKGBUILD when public**
- Other distros: Try the latest binary (built for Ubuntu 20.04 LTS, but should work for most distros?)
- Make sure your user is part of the `dialout` group (`# usermod -a -G dialout insertusernamehere`)
- Make sure your user is part of the `dialout` group (`# usermod -a -G dialout insertusernamehere`); you'll be notified on startup if this is necessary.

### For Windows:
##### Requirements: Windows 7 and up (64-bit only).
Expand All @@ -26,15 +26,16 @@ Boards flashed with OpenFIRE *must be plugged in **before** launching the applic

## Building:
### For Linux:
#### Requires `qt-base`, `qt-serialport`, `qt-svg`
#### Arch: requires `qt-base` `qt-serialport` `qt-svg`
#### Debian: requires `qttools5-dev` `libqt5serialport-dev` `libqt5svg-dev` (for Qt5)
- Clone the repo:
```
git clone https://github.com/TeamOpenFIRE/OpenFIRE-App
```
- Setup build directory:
```
cd OpenFIRE-App
mkdir build && mkdir build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
```
- Make:
Expand All @@ -46,17 +47,16 @@ Boards flashed with OpenFIRE *must be plugged in **before** launching the applic
./OpenFIREapp
```
### For Windows:
- Should be buildable through CMake or the QT Creator IDE.
###### TODO: any specific instructions for this? Seong doesn't use Windows.
#### Requires the Qt SerialPort extension to be installed from the Qt Installation Wizard or Qt Maintenance Tool
- Should be buildable through CMake w/ msys2 (follow Arch Linux instructions) or the Qt Creator IDE.
###### TODO: check for accuracy

### TODO:
- Implement version comparison to latest OpenFIRE GitHub release (or at least latest as of the GUI version).
- Add one-click firmware installation/updating from GUI (for both already flashed guns AND RP2040 devices in bootloader mode).
- Add radio buttons for preset TinyUSB Identifier settings (for the extra picky distros that depend on set PIDs or names...)
- Add icon, logo.
- Layouts code should be prettier, though Qt really encourages wanton destruction of objects just to clear pages.

### Special Thanks:
- Samuel Ballentyne, Prow7, and co. for their work on the SAMCO system that lead to the creation of GUN4ALL & OpenFIRE.
- ArcadeForums posters that voiced their thoughts and suggestions for the GUN4ALL project.
- GUN4ALL testers and everyone that provided feedback to GUN4ALL.
* Samuel Ballentyne, Mike Lynch/Prow7, and co. for their work on the SAMCO system & derivatives, and supporting work and conception of OpenFIRE.
* Odwalla-J, mykylegp, SawdustMaker & lemmingDev for prerelease consultation, bug testing and feedback.
* All early IR-GUN4ALL testers and ArcadeForums users whom provided early testing and feedback.
2,439 changes: 2,439 additions & 0 deletions boardPics/picow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 31 additions & 18 deletions constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
enum boardTypes_e {
nothing = 0,
rpipico,
rpipicow,
adafruitItsyRP2040,
adafruitKB2040,
arduinoNanoRP2040,
waveshareZero,
vccgndYD,
generic = 255
};

Expand All @@ -44,24 +46,27 @@ enum boardInputs_e {
btnGunLeft,
btnGunRight,
btnPedal,
btnPedal2,
btnHome,
btnPump,
rumblePin,
solenoidPin,
rumbleSwitch,
solenoidSwitch,
autofireSwitch,
neoPixel,
ledR,
ledG,
ledB,
neoPixel,
camSDA,
camSCL,
periphSDA,
periphSCL,
battery,
analogX,
analogY,
tempPin
tempPin,
boardInputsCount
};

enum boolTypes_e {
Expand All @@ -73,7 +78,8 @@ enum boolTypes_e {
holdToPause,
commonAnode,
lowButtonsMode,
rumbleFF
rumbleFF,
boolTypesCount
};

enum settingsTypes_e {
Expand All @@ -82,9 +88,14 @@ enum settingsTypes_e {
solenoidNormalInterval,
solenoidFastInterval,
solenoidHoldLength,
customLEDcount,
autofireWaitFactor,
holdToPauseLength
holdToPauseLength,
customLEDcount,
customLEDstatic,
customLEDcolor1,
customLEDcolor2,
customLEDcolor3,
settingsTypesCount
};

enum pinTypes_e {
Expand Down Expand Up @@ -112,10 +123,12 @@ typedef struct tinyUSBtable_t {
} tinyUSBtable_s;

typedef struct profilesTable_t {
uint16_t xScale;
uint16_t yScale;
uint16_t xCenter;
uint16_t yCenter;
uint16_t topOffset;
uint16_t bottomOffset;
uint16_t leftOffset;
uint16_t rightOffset;
uint16_t TLled;
uint16_t TRled;
uint8_t irSensitivity;
uint8_t runMode;
bool layoutType;
Expand All @@ -139,29 +152,29 @@ const boardLayout_t rpipicoLayout[] = {
{btnPedal, pinDigital}, {btnTrigger, pinDigital},
{solenoidPin, pinDigital}, {rumblePin, pinDigital},
{btnUnmapped, pinDigital}, {btnUnmapped, pinDigital},
{camSCL, pinDigital}, {camSDA, pinDigital},
{camSDA, pinDigital}, {camSCL, pinDigital},
{btnUnmapped, pinDigital}, {btnReserved, pinNothing}, // 23, 24, 25
{btnReserved, pinNothing}, {btnReserved, pinNothing}, // are unused/unexposed
{btnUnmapped, pinAnalog}, {btnUnmapped, pinAnalog}, // ADC pins
{btnUnmapped, pinAnalog}, {-2, pinNothing} // ADC, padding
};

const boardLayout_t adafruitItsyRP2040Layout[] = {
{btnGunUp, pinDigital}, {btnGunDown, pinDigital},
{btnUnmapped, pinDigital}, {btnUnmapped, pinDigital},
{camSDA, pinDigital}, {camSCL, pinDigital},
{btnGunLeft, pinDigital}, {btnGunRight, pinDigital},
{btnTrigger, pinDigital}, {btnGunA, pinDigital},
{btnGunB, pinDigital}, {btnGunC, pinDigital},
{btnStart, pinDigital}, {btnSelect, pinDigital},
{btnPedal, pinDigital}, {btnReserved, pinNothing},
{btnPedal, pinDigital}, {btnUnmapped, pinDigital},
{btnTrigger, pinDigital}, {btnGunDown, pinDigital},
{btnGunLeft, pinDigital}, {btnGunUp, pinDigital},
{btnGunRight, pinDigital}, {btnGunC, pinDigital},
{btnUnmapped, pinDigital}, {btnReserved, pinNothing},
{btnReserved, pinNothing}, {btnReserved, pinNothing},
{btnReserved, pinNothing}, {btnReserved, pinNothing},
{btnUnmapped, pinDigital}, {btnUnmapped, pinDigital},
{btnUnmapped, pinDigital}, {btnReserved, pinNothing},
{btnReserved, pinNothing}, {btnReserved, pinNothing},
{rumblePin, pinDigital}, {solenoidPin, pinDigital},
{btnUnmapped, pinAnalog}, {btnUnmapped, pinAnalog},
{btnUnmapped, pinAnalog}, {btnUnmapped, pinAnalog}
{btnGunB, pinAnalog}, {btnGunA, pinAnalog},
{btnStart, pinAnalog}, {btnSelect, pinAnalog}
};

const boardLayout_t adafruitKB2040Layout[] = {
Expand Down
Loading

0 comments on commit 5eb5518

Please sign in to comment.