-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 962ce8b
Showing
1,632 changed files
with
499,660 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[build] | ||
target = "./armv7a-vex-v5.json" | ||
|
||
[target.wasm32-unknown-unknown] | ||
rustflags = ["-Clink-arg=--export-memory", "-Clink-arg=--import-table"] | ||
|
||
[unstable] | ||
build-std = ["core", "compiler_builtins", "alloc"] | ||
build-std-features = ["compiler-builtins-mem"] | ||
|
||
[env] | ||
WAMR_LLVM_TARGET = "armv7a-vex-v5" | ||
WAMR_BUILD_TARGET = "ARMV7" | ||
BINDGEN_EXTRA_CLANG_ARGS_armv7a_vex_v5 = "-I../../sysroot/include --sysroot=../../sysroot --target=armv7a-none-eabi" | ||
CC_armv7a_vex_v5 = "arm-none-eabi-gcc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup | Toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2024-02-07 | ||
components: rust-src | ||
|
||
- name: Check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
# Direnv | ||
.direnv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "wasm3-rs"] | ||
path = wasm3-rs | ||
url = https://github.com/wasm3/wasm3-rs.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"recommendations": [ | ||
"rust-lang.rust-analyzer", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"rust-analyzer.check.targets": [ | ||
"${workspaceFolder}/armv7a-vex-v5.json", | ||
"wasm32-unknown-unknown" | ||
], | ||
"rust-analyzer.check.allTargets": false, | ||
"rust-analyzer.cargo.features": "all", | ||
"rust-analyzer.check.command": "clippy" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[workspace] | ||
members = ["packages/*"] | ||
exclude = ["wasm3-rs"] | ||
resolver = "2" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[workspace.dependencies] | ||
vex-sdk = "0.23.0" | ||
|
||
[workspace.dependencies.vexide] | ||
git = "https://github.com/vexide/vexide.git" | ||
default-features = false | ||
features = ["core", "devices", "async", "panic"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
# vexide Template | ||
|
||
[![Build status](https://github.com/vexide/vexide-template/actions/workflows/build.yml/badge.svg)](https://github.com/vexide/vexide-template/actions/workflows/build.yml) | ||
|
||
> Ready-to-use template for developing VEX V5 robots in Rust. | ||
Seasoned vexide user? Delete README.md and update Cargo.toml as needed. | ||
|
||
## Table of Contents | ||
|
||
- [vexide Template](#vexide-template) | ||
- [Table of Contents](#table-of-contents) | ||
- [Using This Template](#using-this-template) | ||
- [Getting Started (Windows)](#getting-started-windows) | ||
- [Getting Started (macOS)](#getting-started-macos) | ||
- [Getting Started (NixOS)](#getting-started-nixos) | ||
- [Getting Started (Debian/Ubuntu Linux)](#getting-started-debianubuntu-linux) | ||
- [Getting Started (Fedora Linux)](#getting-started-fedora-linux) | ||
- [Learn](#learn) | ||
- [Development](#development) | ||
- [Compiling and uploading to a VEX V5 robot](#compiling-and-uploading-to-a-vex-v5-robot) | ||
- [Viewing program output](#viewing-program-output) | ||
|
||
## Using This Template | ||
|
||
To start a project using this template, click the "Use this template" button in the upper right corner of the GitHub repository. Choose an appropriate name and clone the new repository using Git. Finally, update the package name in `Cargo.toml`: | ||
|
||
```toml | ||
[package] | ||
name = "my-vex-robot" | ||
version = "0.1.0" | ||
edition = "2021" | ||
``` | ||
|
||
You can also configure your program slot and upload behavior in `Cargo.toml`: | ||
|
||
```toml | ||
[package.metadata.v5] | ||
slot = 1 | ||
icon = "cool-x" | ||
compress = true | ||
``` | ||
|
||
> See our [Building & Uploading tutorial](https://vexide.dev/docs/building-uploading/) for more information. | ||
## Getting Started (Windows) | ||
|
||
Follow the instructions [here](https://www.rust-lang.org/tools/install) to install `rustup`. | ||
|
||
Run the following commands in Powershell to set up your PC for development on Windows. | ||
|
||
- Switch to the `nightly` rust toolchain and add the `rust-src` component: | ||
|
||
```console | ||
rustup default nightly | ||
rustup component add rust-src | ||
``` | ||
|
||
- Install cargo-v5: | ||
|
||
```console | ||
cargo install cargo-v5 | ||
``` | ||
|
||
## Getting Started (macOS) | ||
|
||
Follow the instructions [here](https://www.rust-lang.org/tools/install) to install `rustup` on your Mac. | ||
|
||
Run the following commands in a terminal window to setup development with vexide. | ||
|
||
- Open a terminal and configure `rustup` to build for the V5's platform target: | ||
|
||
- Switch to the `nightly` rust toolchain and add the `rust-src` component: | ||
|
||
```console | ||
rustup default nightly | ||
rustup component add rust-src | ||
``` | ||
|
||
- Install cargo-v5: | ||
|
||
```console | ||
cargo install cargo-v5 | ||
``` | ||
|
||
## Getting Started (NixOS) | ||
|
||
The Nix flake includes a devshell with every tool you need for building and uploading vexide projects. | ||
|
||
There is a `.envrc` file for Nix + Direnv users. | ||
|
||
## Getting Started (Debian/Ubuntu Linux) | ||
|
||
Follow the instructions [here](https://www.rust-lang.org/tools/install) to install `rustup`. You may also prefer to install it from your system package manager or by other means. Instructions on that can be found [here](https://rust-lang.github.io/rustup/installation/other.html). | ||
|
||
Run the following terminal commands to set up development on Debian or Ubuntu. | ||
|
||
- Switch to the `nightly` rust toolchain and add the `rust-src` component: | ||
|
||
```console | ||
rustup default nightly | ||
rustup component add rust-src | ||
``` | ||
|
||
- Install cargo-v5: | ||
|
||
```console | ||
cargo install cargo-v5 | ||
``` | ||
|
||
## Getting Started (Fedora Linux) | ||
|
||
Run the following terminal commands to set up your PC for development on Fedora. | ||
|
||
- Install Rust: | ||
|
||
```console | ||
sudo dnf install rustup | ||
rustup-init -y --default-toolchain nightly | ||
``` | ||
|
||
- Close and reopen the terminal, and finish installing vexide: | ||
|
||
```console | ||
rustup component add rust-src | ||
cargo install cargo-v5 | ||
``` | ||
|
||
## Learn | ||
|
||
[Check out the documentation](https://vexide.dev/docs/) on the official vexide website for walkthrough-style guides and other helpful learning resources! | ||
|
||
An [API reference](https://docs.rs/vexide) is also provided by docs.rs. | ||
|
||
## Development | ||
|
||
### Compiling and uploading to a VEX V5 robot | ||
|
||
Use the cargo-pros terminal utility to build and upload this vexide project. | ||
|
||
```console | ||
cargo v5 build | ||
``` | ||
|
||
Use a USB cable to connect to your robot brain or to your controller before using the `upload` subcommand to build and upload the project. Make sure to specify a program slot. | ||
|
||
```console | ||
cargo v5 upload | ||
``` | ||
|
||
### Viewing program output | ||
|
||
You can view panic messages and calls to `println!()` using the PROS terminal. | ||
Use a USB cable to connect to your robot brain or controller, then start the terminal: | ||
|
||
```console | ||
cargo v5 terminal | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"cpu": "cortex-a9", | ||
"arch": "arm", | ||
"abi": "eabihf", | ||
"os": "none", | ||
"vendor": "vex", | ||
"env": "v5", | ||
"panic-strategy": "abort", | ||
"relocation-model": "static", | ||
"llvm-target": "armv7a-none-eabihf", | ||
"features": "+v7,+neon,+vfp3,+thumb2", | ||
"linker": "rust-lld", | ||
"linker-flavor": "ld.lld", | ||
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", | ||
"max-atomic-width": 64, | ||
"c-enum-min-bits": 8, | ||
"target-pointer-width": "32", | ||
"executables": true, | ||
"post-link-args": { | ||
"ld.lld": ["-Tv5.ld"] | ||
}, | ||
"has-thumb-interworking": true, | ||
"default-uwtable": true, | ||
"disable-redzone": true, | ||
"emit-debug-gdb-scripts": false | ||
} |
Oops, something went wrong.