Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feat/distance-senso…
Browse files Browse the repository at this point in the history
…r-object-size
  • Loading branch information
Tropix126 committed Mar 3, 2024
2 parents 2697da9 + c25d1a2 commit 8110f8b
Show file tree
Hide file tree
Showing 96 changed files with 4,460 additions and 2,011 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: nightly-2024-02-07
override: true

- name: Check
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: nightly-2024-02-07
override: true

- name: Setup | Install Rustfmt
Expand All @@ -57,4 +57,4 @@ jobs:
with:
reporter: 'github-pr-check'
github_token: ${{ secrets.GITHUB_TOKEN }}
clippy_flags: --all-targets --all-features
clippy_flags: --all-targets --all-features
79 changes: 77 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,75 @@ Before releasing:

### Added

- `object_size` method on `DistanceSensor` for getting a guess at an object's relative size.

### Fixed

### Changed

### Removed

## [0.8.0]

### Added
- Added feedforward motor controllers (#80)
- Lightly document all APIs with missing documentation. (#70)
- Added `Debug`, `Copy`, and `Clone` derives for common structs (#70)
- Screen drawing API. (#81)
- Added screen field to `Peripherals` and `DynamicPeripherals::take_screen` method. (#81)
- Added `AdiSolenoid`, a wrapper over `AdiDigitalOut` for actuating SMC pneumatic solenoids. (#61)
- Added `AdiSwitch`, another `AdiDigitalOut` wrapper that abstracts bumper switches and limit switches. (#61)
- Added `AdiLineTracker` for abstracting the EDR line tracker sensor.

### Fixed

- Fix error handling and error type variats in ADI bindings
- Fix `AsynRobot` only running opcontrol
- Properly handle `EADDRINUSE` return for smart port errors (**Breaking Change**) (#97)

### Changed

- Re-exported printing macros from `pros::io`. (#82)
- Applied several lints to improve code quality. (#70)
- Updated to PROS version 4. (**Breaking Change**) (#81)
- Moved `vision::Rgb` into its own `color.rs` file. (**Breaking Change**) (#81)
- The VEXOS target has been updated to improve file size and floating point operation speed. (#81)
- `Peripherals::new()` is no longer const (**Breaking Change) (#81)
- Updated panic handler to print to the brain display as well as over serial (#81)
- Refactors digital and analog ADI input/output. (**Breaking Change**) (#61)
- Adds LogicLevel rather than bools for controlling digital devices.
- Adds 0-5V voltage getters and setters for analog ADI.
- Changed analog getters and setters to use `u16` data.
- Changed `AdiPotentiometer` to return degrees rather than tenth degrees (**Breaking Change**) (#61).
- Renamed `AdiPotentiometer::value` to `AdiPotentiometer::angle`.
- Refactors `AdiMotor` to match the smart motor APIs, having output/raw output getters/setters.
- Renamed `AdiUltrasonic::value` to `AdiUltrasonic::distance` (**Breaking Change**) (#61).
- Renamed `AdiEncoder::value` to `AdiEncoder::position` (**Breaking Change**) (#61).
- Repurposed `AdiAnalogOut` as `AdiPwmOut` to correct match port output. (**Breaking Change**) (#90).
- Moved most device-related constants into their associated struct `impl` (**Breaking Change**) (#98).
- Renamed IMU_RESET_TIMEOUT to `InertialSensor::CALIBRATION_TIMEOUT` (**Breaking Change**) (#98).
- Repurposed the `pros` crate as a metapackage without any code of its own. (**Breaking Change**) (#86)
- Split the pros-rs into several small subcrates. (**Breaking Change**) (#86)
- `pros-async` with the async executor and robot trait.
- `pros-devices` for device bindings.
- `pros-sync` for the sync robot trait.
- `pros-core` with basic abstractions over `pros-sys` needed to compile a program to the brain.
- `pros-math` with commonly used controllers and other mathematical models.
- `pros-panic` for the panic handler implementation.

### Removed

- LVGL bindings (pros-sys) and colors (pros). (**Breaking Change**) (#81)
- LLEMU/lcd bindings. (**Breaking Change**) (#81)
- Re-exported printing macros from `pros::io`. (#82)
- Applied several lints to improve code quality. (#70)
- Removed the confusingly named `write`, `ewrite`, `writeln`, and `ewriteln` macros. (**Breaking Change**) (#82)
- Removed AdiDigitalIn::new_press, instead swapping it for AdiSwitch::was_pressed. (**Breaking Change**) (#61)

## [0.7.0]

### Added

- `SmartPort` struct for device access. (#34)
- `SmartDevice` trait for common functionality across smart port devices. (#34)
- Methods to get a device's port number as well as determine if the device is plugged in or not. (#34)
Expand All @@ -36,27 +105,31 @@ Before releasing:
- All ADI device bindings (#55)
- `LocalKey` now has `Cell`/`RefCell`-specific methods for setting and taking values. (#42)
- `Peripherals` and `DynamicPeripherals` structs to ensure that you have only registered one device on a given smart or ADI port. (#53)
- `object_size` method on `DistanceSensor` for getting a guess at an object's relative size.
- Support for ADI Expander modules with `AdiExpander`. (#63)

### Fixed

- Fixed competition state-related getters in the `pros::competition` module. (#38)
- Fixed error handling in IMU sensor bindings. (#37)
- Fixed errors in doctests and examples throughout the crate. (#37)
- Fixed Missing ERRNO and ADI config variants in pros-sys (#55)
- Fixed incorrect error handling with `InertialSensor::status`. (#65)
- `Controller::status` now handles errors by returning `Result<ControllerStatus, ControllerError>`. (**Breaking Change**) (#74)

### Changed

- Overhauled the `competition` module with more straightforward getters for competition state. (#38) (**Breaking Change**)
- LLEMU-related macros have been prefixed with `llemu_` (e.g. `llemu_println`). (**Breaking Change**) (#30)
- Added `Debug`, `Copy`, and `Clone` derives for common structs (#37)
- Renamed `InertialSensor::is_calibrating` to `InertialSensor::calibrating`. (**Breaking Change**) (#65)
- Battery API functions now return `Result<_, BatteryError>`. (**Breaking Change**) (#62)
- Renamed `battery::get_capacity` to `battery::capacity`, `battery::get_current` -> `battery::current`, `battery::get_temperature` -> `battery::temperature`, `battery::get_voltage` -> `battery::voltage`. (**Breaking Change**) (#62)

### Removed

- Removed several broken bindings in `pros_sys` relating to competition state. (#38) (**Breaking Change**)
- `LocalKey` no longer implements `set` for non-`Cell`/`RefCell` stored values. (**Breaking change**) (#42)
- Removed the now-redundant `InertialStatus::error` function. (**Breaking Change**) (#65)

## [0.6.0] - 2024-01-14

Expand Down Expand Up @@ -117,7 +190,9 @@ Before releasing:

### Removed

[unreleased]: https://github.com/pros-rs/pros-rs/compare/v0.6.0...HEAD
[unreleased]: https://github.com/pros-rs/pros-rs/compare/v0.8.0...HEAD
[0.4.0]: https://github.com/pros-rs/pros-rs/releases/tag/v0.4.0
[0.5.0]: https://github.com/pros-rs/pros-rs/compare/v0.4.0...v0.5.0
[0.6.0]: https://github.com/pros-rs/pros-rs/compare/v0.5.0...v0.6.0
[0.7.0]: https://github.com/pros-rs/pros-rs/compare/v0.6.0...v0.7.0
[0.8.0]: https://github.com/pros-rs/pros-rs/compare/v0.7.0...v0.8.0
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[workspace]
members = ["packages/*"]
resolver = "2"

[workspace.lints.rust]
rust_2018_idioms = "warn"
missing_docs = "warn"
unsafe_op_in_unsafe_fn = "warn"

[workspace.lints.clippy]
missing_const_for_fn = "warn"
6 changes: 3 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is the todo list for the eventual 1.0.0 release of pros-rs
* [ ] (Custom) Gear Ratios
* [X] Make Robot Functions Take Self
* [X] PID controllers
* [ ] Feedforward loops
* [X] Feedforward loops
* [ ] ADI (3 wire ports)
* [ ] Ext. ADI
* [X] Sensors
Expand All @@ -34,9 +34,9 @@ This is the todo list for the eventual 1.0.0 release of pros-rs
* [X] Async runtime
* [X] Returning top level futures
* [X] Reactor
* [ ] More asynchronous APIs
* [ ] More asynchronous APIs
* [ ] MPSC
* [X] Task Locals
* [X] Task Locals

## API

Expand Down
8 changes: 5 additions & 3 deletions armv7a-vexos-eabi.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"cpu": "cortex-a9",
"arch": "arm",
"data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
"disable-redzone": true,
"emit-debug-gdb-scripts": false,
"env": "newlib",
"executables": true,
"features": "+v7,+thumb2,+soft-float,-neon,+strict-align",
"features": "+thumb2,+neon,+vfp3",
"linker": "arm-none-eabi-gcc",
"linker-flavor": "gcc",
"llvm-target": "armv7a-none-eabi",
Expand All @@ -16,11 +17,12 @@
"-nostartfiles",
"-nostdlib",
"-Wl,-Tv5.ld,-Tv5-common.ld,--gc-sections",
"-Wl,--start-group,-lpros,-lc,-lm,-lgcc,-lstdc++,--end-group"
"-Wl,--start-group,-lgcc,-lpros,-lc,--end-group"
]
},
"relocation-model": "static",
"target-family": "unix",
"target-pointer-width": "32",
"os": "vexos"
"os": "vexos",
"vendor": "vex"
}
15 changes: 15 additions & 0 deletions packages/pros-async/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "pros-async"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-task = { version = "4.5.0", default-features = false }
pros-core = { version = "0.1.0", path = "../pros-core" }
waker-fn = "1.1.1"
pros-sys = { version = "0.7.0", path = "../pros-sys" }

[lints]
workspace = true
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use core::{
};

use async_task::{Runnable, Task};
use pros_core::{os_task_local, task::delay};
use waker_fn::waker_fn;

use super::reactor::Reactor;
use crate::{os_task_local, task::delay};

os_task_local! {
pub(crate) static EXECUTOR: Executor = Executor::new();
Expand All @@ -27,7 +27,7 @@ impl !Send for Executor {}
impl !Sync for Executor {}

impl Executor {
pub fn new() -> Self {
pub const fn new() -> Self {
Self {
queue: RefCell::new(VecDeque::new()),
reactor: RefCell::new(Reactor::new()),
Expand Down
Loading

0 comments on commit 8110f8b

Please sign in to comment.