Merge branch 'bunnie-dev' into main

This commit is contained in:
bunnie 2022-04-08 01:34:02 +08:00
commit a85d9ad18b
3 changed files with 9 additions and 3 deletions

3
API.md
View file

@ -1,3 +1,6 @@
The [Xous Book](https://betrusted.io/xous-book/ch07-02-caller-idioms.html) reviews the system architecture and breaks down the various API idioms chapter-by-chapter.
This document conveys much of the similar information, but in a more monolithic form. This document also does not cover [deferred response](https://betrusted.io/xous-book/ch07-06-deferred.html) idioms.
## Xous Messaging API In Practice

View file

@ -127,6 +127,7 @@ for examples of idiomatic ways to write code for Xous.
- Sleep screen is now blanked of all prior content and just the sentinel message is held
- Sleep/suspend lightly refactored to fix some bugs. Ticktimer is now the sole `Last` event.
- Preliminary text to speech (TTS) support added; compile with `cargo xtask tts` or set the LOCALE to `en-tts` to try it out.
- Introduce deferred-response pattern into modals, pddb, and susres.
## Roadmap to 1.0

View file

@ -1,6 +1,7 @@
#![cfg_attr(target_os = "none", no_std)]
pub mod api;
pub use api::*;
use xous::{CID, send_message};
use num_traits::ToPrimitive;
@ -8,12 +9,13 @@ pub struct Codec {
conn: CID,
}
impl Codec {
pub fn new(xns: &xous_names::XousNames) -> Result<Self, xous::Error> {
pub fn new() -> Self {
let xns = xous_names::XousNames::new().expect("couldn't connect to XousNames");
REFCOUNT.fetch_add(1, Ordering::Relaxed);
let conn = xns.request_connection_blocking(api::SERVER_NAME_CODEC).expect("Can't connect to Codec server");
Ok(Codec {
Codec {
conn
})
}
}
}