Skip to content

Commit

Permalink
yea it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
doinkythederp committed Nov 6, 2024
0 parents commit 962ce8b
Show file tree
Hide file tree
Showing 1,632 changed files with 499,660 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .cargo/config.toml
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"
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
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
97 changes: 97 additions & 0 deletions .gitignore
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/
3 changes: 3 additions & 0 deletions .gitmodules
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
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
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"
}
14 changes: 14 additions & 0 deletions Cargo.toml
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"]
158 changes: 158 additions & 0 deletions README.md
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
```
26 changes: 26 additions & 0 deletions armv7a-vex-v5.json
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
}
Loading

0 comments on commit 962ce8b

Please sign in to comment.