Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
dee3d53
add buffer and handling
PA055 May 22, 2024
246c781
added line cycleing
PA055 May 22, 2024
e129183
fix critical bug :)
PA055 May 22, 2024
1042eba
Merge branch 'main' into text
ion098 May 22, 2024
2b8d9c9
add rumble and make clarity changes
PA055 May 22, 2024
4be8668
Merge branch 'text' of https://github.com/PA055/Gamepad into text
PA055 May 22, 2024
3fc76b4
merge changes
PA055 May 22, 2024
0d64b62
oops, forgot the rumble function
PA055 May 22, 2024
f04764b
check for rumble pattern length
PA055 May 23, 2024
c5a8982
changed std::uint... to uint...
PA055 May 23, 2024
acda18e
Minor change to formatting to trigger pros-build action
ion098 May 23, 2024
dd053c2
Merge branch 'LemLib:main' into text
PA055 May 23, 2024
26053a5
Fixed off by one error in Gamepad::updateScreen
ion098 May 24, 2024
735acae
add rumble to cycle
PA055 May 26, 2024
3817758
Merge branch 'text' of https://github.com/PA055/Gamepad into text
PA055 May 26, 2024
d457248
Merge branch 'LemLib:main' into text
PA055 Jun 3, 2024
d1394b3
seperate alerts and prints
PA055 Jun 4, 2024
5cdd7a1
change rumble from alert like to print like
PA055 Jun 8, 2024
749edf4
feat: :sparkles: add drive curve implementation
ion098 Jun 17, 2024
1ca81b0
feat: :sparkles: Add joystick curves to controller
ion098 Jun 17, 2024
0772340
style: :art: Format event_handler.hpp
ion098 Jun 17, 2024
846ba1a
fix: :bug: Fix variable name typo
ion098 Jun 25, 2024
734183b
refactor: :construction: Remove deadband from curve
ion098 Jun 25, 2024
2bc3862
add multi line alerts
PA055 Jun 26, 2024
1e8182e
add ability to have newlines in alerts
PA055 Jun 26, 2024
ec5c814
make add_alerts private
PA055 Jun 27, 2024
599d3c1
remove unnessasary lines parameter
PA055 Jun 28, 2024
20138bb
add multiline prints
PA055 Jul 6, 2024
e73d095
add rumbles to alerts
PA055 Jul 8, 2024
57371a6
refactored screen update loop
PA055 Jul 8, 2024
022b4df
add thread safety... hopefully?
PA055 Jul 8, 2024
a84efd3
Merge branch 'main' into text
ion098 Jul 20, 2024
b8eb242
some comments
PA055 Jul 27, 2024
f0fa75f
Merge branch 'text' of https://github.com/PA055/Gamepad into text
PA055 Jul 28, 2024
12f4d6f
finished abstract screen interface
PA055 Aug 12, 2024
7781c59
moved the stuff that needs to be moved... kinda
PA055 Aug 13, 2024
18a4ed6
why am i getting these errors💔
PA055 Aug 13, 2024
66945cf
idk what happened but no errors now, also screen update works hopefully
PA055 Aug 13, 2024
4b17c36
shared pointers :sparkles:
PA055 Aug 13, 2024
6c90b92
it builds now
PA055 Aug 13, 2024
8dbb732
alerts should work
PA055 Aug 18, 2024
3929050
Merge branch 'main' into text
ion098 Aug 23, 2024
23c4bbf
what should i do for this?
PA055 Sep 4, 2024
bf82fef
Merge branch 'text' of https://github.com/PA055/Gamepad into text
PA055 Sep 4, 2024
790929c
bug fixing :sob:
PA055 Sep 10, 2024
d82ef22
help :skull:
PA055 Sep 10, 2024
385fc82
why do i need to commit debug.log :interrobang:
PA055 Sep 10, 2024
8395b9b
Merge branch 'main' into text
PA055 Sep 10, 2024
d5b226a
idk but this breaks it
PA055 Sep 10, 2024
466b8e1
bug: :bug: explicit controller constructor isnt getting called
PA055 Sep 21, 2024
9bfcbb3
fix: :construction: it might work
PA055 Sep 25, 2024
4958fa1
feat: :construction_worker: add vexide sim devcontainer
PA055 Sep 25, 2024
2797d2c
feat: 👷 add launch configs and tasks
PA055 Sep 26, 2024
76f1af3
feat: :construction: Hot/Cold linking breaks it
PA055 Sep 26, 2024
4a70a4a
fix: :construction: reenable hot-cold
ion098 Sep 27, 2024
c50258f
refactor: :twisted_rightwards_arrows: Merge branch 'main' into text
PA055 Sep 27, 2024
b2e027b
fix: :construction: more testing
ion098 Sep 27, 2024
59c588b
Merge branch 'main' of https://github.com/LemLib/Gamepad into feature…
ion098 Oct 2, 2024
075c379
fix: :bug: Fix usage of unintialized fields
ion098 Oct 10, 2024
fe7fa7a
fix: :bug: initalize attributes in all classes
PA055 Oct 10, 2024
db239d4
chore: :twisted_rightwards_arrows: Merge branches
PA055 Oct 10, 2024
72ecda3
fix: :bug: Fix bug where AbsrtactScreen was not abstract
PA055 Oct 12, 2024
d06277a
fix: :bug: fix nullpointers getting turned into empty strings
PA055 Oct 12, 2024
c357038
fix: :bug: multiples line changes not registering
PA055 Oct 12, 2024
a1c3f15
fix: :bug: screen not being cleared first print
PA055 Oct 12, 2024
dd06cda
chore: :poop: get_priority is the problem, idk why
PA055 Oct 12, 2024
82c0937
test: :sparkles: the alerts are kinda working
PA055 Oct 13, 2024
b1e4093
fix: :bug: repeated alert rumbles
PA055 Oct 13, 2024
aa4904d
chore: :fire: remove debug prints
PA055 Oct 13, 2024
993960f
chore: :fire: remove debug prints
PA055 Oct 13, 2024
5606ac5
Merge branch 'text' of https://github.com/PA055/Gamepad into text
PA055 Oct 13, 2024
a5f29cb
refactor: :art: run clang-format
PA055 Oct 13, 2024
85be74a
feat: :sparkles: disconnect/reconnect logic
PA055 Oct 16, 2024
e22f373
ci: :green_heart: Upload template zip on build
ion098 Oct 28, 2024
6400155
ci: :construction_worker: Build and upload template on release
ion098 Oct 28, 2024
0dc0a36
Merge pull request #22 from LemLib/ci/fix-build-action
ion098 Oct 28, 2024
ae85554
fix: :pencil2: remove merge conflict markers
ion098 Oct 29, 2024
e3e6aa2
Merge branch 'main' into feature/joystick-enhancements
ion098 Oct 29, 2024
982c53b
fix: :bug: Fix compile errors from merging
ion098 Oct 29, 2024
e7f7495
refactor: :construction: Start work on joystick modifier classes
ion098 Oct 30, 2024
6812d03
test line clearing
PA055 Oct 31, 2024
297295a
feat: :sparkles: Add fisheye joystick modifier
ion098 Nov 2, 2024
83c8315
feat: :construction: Add ability to add transformations to gamepad
ion098 Nov 4, 2024
67695e4
style: :art: Fix formatting in joystick_modifier.hpp
ion098 Nov 4, 2024
9c16e78
Merge branch 'main' into text
ion098 Nov 4, 2024
e27010e
docs: :memo: Added all of the documentation
PA055 Nov 13, 2024
0237fe8
feat: :sparkles: actually impliment the handle_events interface
PA055 Nov 13, 2024
f70c9d6
docs: :memo: Add examples
PA055 Nov 13, 2024
2a7ff7a
fix: :bug: actually make it compile
PA055 Nov 13, 2024
bdcd568
chore: :fire: removed debug.log
PA055 Nov 15, 2024
e0db1e4
refactor: :white_check_mark: address code review comments
PA055 Nov 15, 2024
fd99f2a
docs: :memo: Add docs to Gamepad and Transformations
ion098 Nov 16, 2024
9016a41
style: :art: fix docs formatting
ion098 Nov 18, 2024
e54e6c7
style: :art: remove trailing whitespace
ion098 Nov 18, 2024
a1cb6d7
style: :art: fix formatting of doc comments
ion098 Nov 19, 2024
453a2df
refactor: :recycle: Move methods from header to src file
ion098 Nov 19, 2024
335a1f4
fix: :bug: Fix outdated code in main.cpp
ion098 Nov 19, 2024
057f8d7
ci: :fire: remove .devcontainer files because of licence stuff
PA055 Nov 19, 2024
7e00807
chore: :technologist: add devcontainer setup with sim
ion098 Nov 21, 2024
6e70274
Merge pull request #23 from LemLib/chore/devcontainer-setup
ion098 Nov 21, 2024
261d886
Merge branch 'main' into feature/joystick-enhancements
ion098 Nov 21, 2024
1c07cd3
fix: :bug: Fix bugs in Deadband, ExpoCurve, and Transformation
ion098 Nov 28, 2024
371182d
fix: :bug: Fix bug in Fisheye
ion098 Nov 28, 2024
1febcc0
Merge branch 'main' into text
PA055 Dec 7, 2024
4afd080
Merge pull request #1 from PA055/text
ion098 Dec 7, 2024
d2c4702
refactor: :recycle: change method names to use lowerCamelCase
ion098 Dec 16, 2024
41d3ee3
refactor: :recycle: Change all member variables to use m_, remove usa…
ion098 Dec 31, 2024
f9f822f
Merge pull request #24 from LemLib/refactor/fix-naming
ion098 Jan 2, 2025
458d0de
refactor: :goal_net: Change error handling in screen code to use errno
ion098 Jan 2, 2025
366415f
style: :art: Fix formatting
ion098 Jan 2, 2025
1473733
refactor: :goal_net: Add return value to functions that set errno
ion098 Jan 4, 2025
277b084
refactor: :recycle: Change functions to return 0 on success
ion098 Jan 8, 2025
4da1dc5
refactor: :technologist: Hide TODO messages from compiler output
ion098 Jan 22, 2025
5a5fced
refactor: :recycle: Change functions to return int32_t error codes
ion098 Jan 22, 2025
f127b09
style: :art: Format code
ion098 Jan 22, 2025
8828d33
fix: :bug: Fix Fisheye transformation implementation
ion098 Jan 29, 2025
a347bd5
refactor: :recycle: Factor out common code in deadband impl
ion098 Jan 29, 2025
08e6723
refactor: :label: Change functions returning uint32_t to return int32_t
ion098 Jan 29, 2025
0ac0ebd
fix: :bug: Fix broken impl of Button::removeListener
ion098 Feb 2, 2025
607f3fc
fix(display): :bug: Add handling for too big messages
ion098 Feb 3, 2025
38aa8d9
refactor(buttons): :heavy_minus_sign: Remove unneeded include
ion098 Feb 3, 2025
739c0f5
docs(display): :memo: Document all possible errno values
ion098 Feb 3, 2025
0ffae91
chore: :technologist: Add conventional commits scopes
ion098 Feb 3, 2025
5ce9764
fix(display): :bug: Return error code from clear method
ion098 Feb 3, 2025
f584161
docs(display): :memo: Fix incorrect docs for error codes
ion098 Feb 3, 2025
34d2d8e
Merge pull request #25 from LemLib/refactor/fix-error-handling
ion098 Feb 3, 2025
896e783
chore: :bookmark: Bump version to 0.3.0
ion098 Feb 8, 2025
f7ae0df
Merge pull request #26 from LemLib/chore/bump-v0.3
ion098 Feb 8, 2025
4502c8d
chore: :technologist: Fix devcontainer build
ion098 Feb 13, 2025
bf41ddf
Merge branch 'main' of https://github.com/LemLib/Gamepad into feature…
ion098 Feb 18, 2025
672229a
style: :art: Format code
ion098 Feb 19, 2025
4b17072
ci: :green_heart: Update clang-format CI to v19
ion098 Feb 19, 2025
169b65d
Merge pull request #33 from LemLib/ci/fix-format-check
ion098 Feb 19, 2025
de12426
Merge branch 'main' into feature/joystick-enhancements
ion098 Feb 19, 2025
18e20da
style: :art: Fix formatting
ion098 Feb 19, 2025
01fa938
Merge pull request #8 from LemLib/feature/joystick-enhancements
ion098 Feb 19, 2025
3a43926
Merge branch 'stable' into main
ion098 Feb 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM rust:1.84 as builder

RUN git clone https://github.com/vexide/vex-v5-qemu.git /vex-v5-qemu

WORKDIR /vex-v5-qemu
RUN cd packages/kernel; cargo build --target-dir /target/kernel

# FIXME: This should probably be removed in the future since it's very fragile
RUN rustup toolchain install nightly

RUN cd packages/client-cli; cargo +nightly install --path . --root /target/client-cli

FROM mcr.microsoft.com/devcontainers/cpp:1-noble
# ------------
# Install Required Packages
# ------------
RUN sudo apt-get update
COPY ./.devcontainer/packagelist /packagelist
RUN sudo apt-get -y install $(cat /packagelist | sed 's/\r//')
RUN rm /packagelist # Cleanup image
RUN sudo apt-get clean # Cleanup image

# ------------
# Install Clangd
# ------------
RUN curl -sLo clangd.zip $( \
curl -s https://api.github.com/repos/clangd/clangd/releases/latest \
| jq -r '[.assets[] | select(.name | test ("^clangd-linux"))][0].browser_download_url' \
) \
&& unzip clangd.zip -d /usr/local/share \
&& mv /usr/local/share/clangd_*/ /usr/local/share/clangd \
&& rm clangd.zip

ENV PATH="$PATH:/usr/local/share/clangd/bin"

# ------------
# Install PROS CLI
# ------------
RUN pip install --break-system-packages pros-cli

# ------------
# Install ARM Toolchain
# ------------
COPY --from=ghcr.io/lemlib/pros-build:v2.0.2 /gcc-arm-none-eabi-10.3-2021.10 /usr/local/share/arm-none-eabi
ENV PATH="$PATH:/usr/local/share/arm-none-eabi/bin"

# Copy the simulator binary
COPY --from=builder /target/client-cli/bin/client-cli /usr/local/bin/simulator

# Clone pros kernel source so we can reference it when debugging
COPY ./project.pros /project.pros
ENV PROS_SOURCE_PATH="$HOME/.pros"
RUN git clone https://github.com/purduesigbots/pros.git $PROS_SOURCE_PATH \
--depth 1 \
--branch $(</project.pros jq -r '.["py/state"].templates.kernel.version')
RUN rm /project.pros # Cleanup image

# Copy the sim kernel, as its required to run the simulator
ENV V5_SIM_PATH="$HOME/.vex-v5-qemu"
ENV V5_SIM_KERNEL_PATH="$V5_SIM_PATH/kernel"
COPY --from=builder /target/kernel/armv7a-none-eabi/debug/kernel $V5_SIM_KERNEL_PATH

# Copy the sim source, so we can reference it when debugging
ENV V5_SIM_SOURCE_PATH="$V5_SIM_PATH/source"
COPY --from=builder /vex-v5-qemu $V5_SIM_SOURCE_PATH
27 changes: 27 additions & 0 deletions .devcontainer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
All files in the .devcontainer folder are taken from
https://github.com/darkMatter781x/HighStakes and are licensed under the MIT
license as follows.

===== BEGIN LICENSE =====

MIT License

Copyright (c) 2024 Andrew Curtis and Kairui Dai

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 20 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
{
"postCreateCommand": "chmod 777 .devcontainer/postCreateCommand.bash && .devcontainer/postCreateCommand.bash && source ~/.bashrc"
}
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {
"clangd.path": "/usr/local/share/clangd/bin/clangd"
},
"extensions": [
"jeff-hykin.better-cpp-syntax",
"llvm-vs-code-extensions.vscode-clangd",
"streetsidesoftware.code-spell-checker",
"cschlosser.doxdocgen",
"ms-azuretools.vscode-docker",
"vivaxy.vscode-conventional-commits"
]
}
}
}
7 changes: 7 additions & 0 deletions .devcontainer/packagelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
git
python3-minimal
python3-pip
pipx
qemu-system
gdb-multiarch
jq
8 changes: 0 additions & 8 deletions .devcontainer/postCreateCommand.bash

This file was deleted.

12 changes: 8 additions & 4 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
path:
- './src/gamepad'
- './include/gamepad'

steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.18
- uses: jidicula/clang-format-action@v4.14.0
with:
source: './src/gamepad ./include/gamepad'
extensions: 'hpp,cpp'
clangFormatVersion: 18
clang-format-version: '19'
check-path: ${{ matrix.path }}
24 changes: 24 additions & 0 deletions .github/workflows/pros-build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build Release

on:
release:
types: [published]

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Build Template
id: build_step
uses: LemLib/[email protected]
with:
lib_folder_name: "gamepad"
copy_readme_and_license_to_include: true
no_commit_hash: true
- name: Upload Template To Release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ github.workspace }}/${{ steps.build_step.outputs.name }}
15 changes: 12 additions & 3 deletions .github/workflows/pros-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: LemLib/[email protected]
- name: Checkout Code
uses: actions/checkout@v4
- name: Build Template
id: build_step
uses: LemLib/[email protected]
with:
library-path: gamepad
lib_folder_name: "gamepad"
copy_readme_and_license_to_include: true
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.build_step.outputs.name }}
path: ${{ github.workspace }}/template/*
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# PROS
bin/
.vscode/
.vscode/*
.cache/
compile_commands.json
temp.log
Expand All @@ -21,3 +21,9 @@ temp.errors

# MacOS
.DS_Store

# Linux
debug.log

# Always include development settings
!.vscode/settings.json
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
],
"conventionalCommits.scopes": [
"buttons",
"display",
"joysticks"
]
}
5 changes: 5 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
All files in this repository are licensed under the MIT license as follows,
unless otherwise noted in another LICENSE file

===== BEGIN LICENSE =====

MIT License

Copyright (c) 2024 Jamie Maki-Fern, Ayaan (ion098), and other contributors
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXCLUDE_COLD_LIBRARIES:=
# Set this to 1 to add additional rules to compile your project as a PROS library template
IS_LIBRARY:=1
LIBNAME:=gamepad
VERSION:=0.2.0
VERSION:=0.3.0
# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
# this line excludes opcontrol.c and similar files
EXCLUDE_SRC_FROM_LIB+=$(foreach file, $(SRCDIR)/main,$(foreach cext,$(CEXTS),$(file).$(cext)) $(foreach cxxext,$(CXXEXTS),$(file).$(cxxext)))
Expand Down
3 changes: 2 additions & 1 deletion include/gamepad/api.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once

#include "gamepad/event_handler.hpp" // IWYU pragma: export
#include "gamepad/controller.hpp" // IWYU pragma: export
#include "gamepad/gamepad.hpp" // IWYU pragma: export
#include "gamepad/screens/alertScreen.hpp" // IWYU pragma: export
Loading
Loading