Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ wifi = []
bluetooth = []

[dependencies]
pd_vm_nostd = { package = "pd-vm-nostd", git = "https://github.com/rustscript-lang/rustscript.git", rev = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73", version = "0.1.0", optional = true }
pd_vm_nostd = { package = "pd-vm-nostd", git = "https://github.com/rustscript-lang/rustscript.git", rev = "2f433edab3f1907e8cb060e901357d7e2af016ce", version = "0.1.0", optional = true }
serialport = { version = "4.8.1", default-features = false, optional = true }
vm = { package = "pd-vm", git = "https://github.com/rustscript-lang/rustscript.git", rev = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73", version = "0.1.0", default-features = false, optional = true }
vm = { package = "pd-vm", git = "https://github.com/rustscript-lang/rustscript.git", rev = "2f433edab3f1907e8cb060e901357d7e2af016ce", version = "0.1.0", default-features = false, optional = true }

[profile.release]
opt-level = "z"
Expand Down
16 changes: 8 additions & 8 deletions docs/framework-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ from the firmware. The Arduino host simulator never registers either module.

The signatures below are RSS signatures. Argument type, arity, and range checks happen in the host
bridge. A rejected call returns a host-dispatch error to the VM. A `bool` result reports whether the
underlying platform operation was accepted. Calls documented as `null` are commands whose success
underlying platform operation was accepted. Calls documented as `()` are commands whose success
is represented by normal completion.

## GPIO
Expand Down Expand Up @@ -78,7 +78,7 @@ ESP32-C3 only:
use i2c;

i2c::open(sda: int, scl: int, frequency: int) -> bool
i2c::close() -> null
i2c::close() -> ()
i2c::transmit(address: int, data: bytes) -> int
i2c::transmit_register(address: int, register: int, data: bytes) -> int
i2c::receive(address: int, length: int) -> bytes
Expand All @@ -95,16 +95,16 @@ empty byte sequence.
```rust
use mcu;

mcu::delay_ms(duration: int) -> null
mcu::delay_us(duration: int) -> null
mcu::delay_ms(duration: int) -> ()
mcu::delay_us(duration: int) -> ()
mcu::millis() -> int
mcu::micros() -> int
mcu::cpu_frequency_mhz() -> int
mcu::free_heap() -> int
mcu::flash_size() -> int
mcu::random() -> int
mcu::restart() -> null
mcu::deep_sleep_us(duration: int) -> null
mcu::restart() -> ()
mcu::deep_sleep_us(duration: int) -> ()
```

On ESP32-C3, `delay_ms` accepts `0..60,000`, `delay_us` accepts `0..1,000,000`, and deep sleep
Expand All @@ -117,7 +117,7 @@ millisecond value. `millis` and `micros` are monotonic uptime counters. `restart
```rust
use serial;

serial::write_line(value: string) -> null
serial::write_line(value: string) -> ()
serial::available() -> int
serial::read_bytes(maximum: int) -> bytes
```
Expand Down Expand Up @@ -172,7 +172,7 @@ The Rust static library exports `rustscript_run_vmbc` and value types from
(context, import_name_bytes, arguments, result) -> status
```

A callback status of `-1` rejects the call, `0` completes a command with `null`, and `1` returns the
A callback status of `-1` rejects the call, `0` completes a command with `()`, and `1` returns the
value written to `result`. String and byte results reference bridge-owned storage and are consumed by
the VM during the call. Platform implementations are located in:

Expand Down
2 changes: 1 addition & 1 deletion src/repl_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ mod tests {
let mut transport = VmTransport::default();
session
.eval(
"let text: Option<string> = Option::Some(\"hello\");",
"let text: Option<string> = Some(\"hello\");",
&mut transport,
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion tests/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ fn stateful_repl_rejects_moved_optional_string_before_transport() {
};
session
.eval(
"let text: Option<string> = Option::Some(\"hello\");",
"let text: Option<string> = Some(\"hello\");",
&mut transport,
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion tests/frozen_core_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::process::Command;
use rustscript_embedded::{RunOutcome, run_source_file};
use vm::{compile_source_file, decode_program, encode_program};

const FROZEN_RUSTSCRIPT_REV: &str = "fc8b0c8179640a8ffe460a64b3690e35c2f7eb73";
const FROZEN_RUSTSCRIPT_REV: &str = "2f433edab3f1907e8cb060e901357d7e2af016ce";
const RUSTSCRIPT_GIT: &str = "https://github.com/rustscript-lang/rustscript.git";
const EXPECTED_BUNDLED_RSS: usize = 4;
const REQUIRED_LOCK_PACKAGES: &[&str] =
Expand Down
Loading