Commit 79e2b7dc authored by Jorge Aparicio's avatar Jorge Aparicio

rename LateResourceValues to LateResources

parent e78ca98c
......@@ -55,7 +55,7 @@ app! {
}
// The signature of `init` is now required to have a specific return type.
fn init(_p: init::Peripherals, _r: init::Resources) -> init::LateResourceValues {
fn init(_p: init::Peripherals, _r: init::Resources) -> init::LateResources {
// `init::Resources` does not contain `IP_ADDRESS`, since it is not yet
// initialized.
//_r.IP_ADDRESS; // doesn't compile
......@@ -63,7 +63,7 @@ fn init(_p: init::Peripherals, _r: init::Resources) -> init::LateResourceValues
// ...obtain value for IP_ADDRESS from EEPROM/DHCP...
let ip_address = 0x7f000001;
init::LateResourceValues {
init::LateResources {
// This struct will contain fields for all resources with omitted
// initializers.
IP_ADDRESS: ip_address,
......
......@@ -234,17 +234,17 @@ fn init(app: &App, main: &mut Vec<Tokens>, root: &mut Vec<Tokens>) {
root.push(quote! {
#[allow(non_camel_case_types)]
#[allow(non_snake_case)]
pub struct _initLateResourceValues {
pub struct _initLateResources {
#(#fields)*
}
});
mod_items.push(quote! {
pub use ::_initLateResourceValues as LateResourceValues;
pub use ::_initLateResources as LateResources;
});
// `init` must return the initialized resources
ret = Some(quote!( -> ::init::LateResourceValues));
ret = Some(quote!( -> ::init::LateResources));
}
root.push(quote! {
......
......@@ -57,7 +57,7 @@
//! }
//!
//! // The signature of `init` is now required to have a specific return type.
//! fn init(_p: init::Peripherals, _r: init::Resources) -> init::LateResourceValues {
//! fn init(_p: init::Peripherals, _r: init::Resources) -> init::LateResources {
//! // `init::Resources` does not contain `IP_ADDRESS`, since it is not yet
//! // initialized.
//! //_r.IP_ADDRESS; // doesn't compile
......@@ -65,7 +65,7 @@
//! // ...obtain value for IP_ADDRESS from EEPROM/DHCP...
//! let ip_address = 0x7f000001;
//!
//! init::LateResourceValues {
//! init::LateResources {
//! // This struct will contain fields for all resources with omitted
//! // initializers.
//! IP_ADDRESS: ip_address,
......
......@@ -30,12 +30,12 @@ app! {
},
}
fn init(_p: init::Peripherals, r: init::Resources) -> init::LateResourceValues {
fn init(_p: init::Peripherals, r: init::Resources) -> init::LateResources {
// Try to use a resource that's not yet initialized:
r.LATE;
//~^ error: no field `LATE`
init::LateResourceValues {
init::LateResources {
LATE: 0,
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment