Skip to content

Commit f669c67

Browse files
Merge pull request #379 from kurtjd/update-docs
Doucment riscv-rt features and fix minor doc issues
2 parents 297e3d5 + 460aac3 commit f669c67

File tree

6 files changed

+39
-8
lines changed

6 files changed

+39
-8
lines changed

riscv-macros/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
### Changed
1515

16+
- Fix `cargo doc` errors.
1617
- Use fully qualified paths in generated code (i.e., `::riscv` instead of `riscv`)
1718
- Moved from `riscv/macros/` to `riscv-macros/`
1819
- Now, `riscv::pac_enum` macro only includes trap-related code if `rt` or `rt-v-trap` features are enabled.

riscv-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ core::arch::global_asm!("
426426
///
427427
/// # Example
428428
///
429-
/// ```rust
429+
/// ```rust,ignore,no_run
430430
/// use riscv::*;
431431
///
432432
/// #[repr(usize)]

riscv-rt/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414

1515
### Changed
1616

17+
- Add features to documentation that were missing and fix `cargo doc` errors.
1718
- Update license to `MIT or Apache-2.0`
1819
- Fix clippy warnings in riscv_rt_macros::strip_type_path
1920
- Bump MSRV to 1.68 for latest syn 2.0 release

riscv-rt/src/lib.rs

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
//!
157157
//! Our application would look like this:
158158
//!
159-
//! ```no_run
159+
//! ```ignore,no_run
160160
//! // src/main.rs
161161
//! #![no_main]
162162
//! #![no_std]
@@ -269,7 +269,7 @@
269269
//!
270270
//! ## Example
271271
//!
272-
//! ``` no_run
272+
//! ``` ignore,no_run
273273
//! extern crate some_allocator; // e.g., embedded_alloc::LlffHeap
274274
//!
275275
//! extern "C" {
@@ -357,7 +357,7 @@
357357
//!
358358
//! The following example shows how to implement the `_mp_hook` function in assembly.
359359
//!
360-
//! ``` no_run
360+
//! ``` ignore,no_run
361361
//! core::arch::global_asm!(
362362
//! r#".section .init.mp_hook, "ax"
363363
//! .global _mp_hook
@@ -433,7 +433,7 @@
433433
//!
434434
//! This function can be redefined in the following way:
435435
//!
436-
//! ``` no_run
436+
//! ``` ignore,no_run
437437
//! #[export_name = "ExceptionHandler"]
438438
//! fn custom_exception_handler(trap_frame: &riscv_rt::TrapFrame) -> ! {
439439
//! // ...
@@ -542,7 +542,7 @@
542542
//!
543543
//! The following example shows how to implement the `__pre_init` function in assembly.
544544
//!
545-
//! ``` no_run
545+
//! ``` ignore,no_run
546546
//! core::arch::global_asm!(
547547
//! r#".section .init.pre_init, "ax"
548548
//! .global __pre_init
@@ -574,6 +574,20 @@
574574
//!
575575
//! Skips interrupts setup.
576576
//!
577+
//! ## `no-xie-xip`
578+
//!
579+
//! Skips disabling interrupts (to support chips without XIE/XIP CSRs).
580+
//!
581+
//! ## `no-interrupts`
582+
//!
583+
//! Opts out of the default implementation for `_dispatch_core_interrupt` to support platforms
584+
//! with custom core interrupt sources.
585+
//!
586+
//! ## `no-exceptions`
587+
//!
588+
//! Opts out of the default implementation for `_dispatch_exception` to support platforms
589+
//! with custom exception sources.
590+
//!
577591
//! ## `s-mode`
578592
//!
579593
//! Supervisor mode. While most registers/instructions have variants for both `mcause` and
@@ -622,7 +636,7 @@
622636
//!
623637
//! ### Example
624638
//!
625-
//! ```rust,no_run
639+
//! ```rust,ignore,no_run
626640
//! core::arch::global_asm!(
627641
//! r#"
628642
//! .section .trap.start, "ax"
@@ -639,6 +653,20 @@
639653
//! "#
640654
//! );
641655
//! ```
656+
//!
657+
//! ## `device`
658+
//!
659+
//! Automatically includes `device.x` (typically provided by PACs to provide weak aliases to interrupt handlers)
660+
//! in the linker script.
661+
//!
662+
//! ## `memory`
663+
//!
664+
//! Automatically includes [`memory.x`](#memoryx) (typically provided by BSPs) in the linker script.
665+
//!
666+
//! ## `defmt`
667+
//!
668+
//! Implements `defmt::Format` on certain types.
669+
//!
642670
//! [attr-entry]: attr.entry.html
643671
//! [attr-exception]: attr.exception.html
644672
//! [attr-external-interrupt]: attr.external_interrupt.html

riscv/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2222

2323
### Changed
2424

25+
- Fix broken links in register macro doc string.
2526
- Moved macros from `./macros/` to `../riscv-macros/`
2627
- Updated the license to `MIT or Apache-2.0`
2728
- Bump MSRV to 1.68 for latest version of syn 2.0

riscv/src/register/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ macro_rules! write_csr_as_usize_rv32 {
303303

304304
/// Convenience macro to provide combined read/write of a CSR as a `usize`.
305305
///
306-
/// This composes [`read_csr_as_usize`] and [`write_csr_as_usize`]. Use the
306+
/// This composes [read_csr_as_usize](crate::read_csr_as_usize) and [write_csr_as_usize](crate::write_csr_as_usize). Use the
307307
/// `safe` form to get safe wrappers instead of unsafe.
308308
#[macro_export]
309309
macro_rules! read_write_csr_as_usize {

0 commit comments

Comments
 (0)