Skip to content

Instantly share code, notes, and snippets.

View jamesmunns's full-sized avatar

James Munns jamesmunns

View GitHub Profile
<peripheral>
<name>FICR</name>
<description>Factory Information Configuration Registers</description>
<groupName>FICR</groupName>
<baseAddress>0x10000000</baseAddress>
<size>32</size>
<addressBlock>
<offset>0</offset>
<size>0x1000</size>
<usage>registers</usage>
#[doc = "Factory Information Configuration Registers"]
pub struct FICR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FICR {}
impl FICR {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const ficr::RegisterBlock {
0x1000_0000 as *const _
}
#[doc = "Factory Information Configuration Registers"]
pub struct FICR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FICR {}
impl FICR {
#[doc = r" Returns a pointer to the register block"]
pub fn ptr() -> *const ficr::RegisterBlock {
0x1000_0000 as *const _
}
--- ficr-before.rs 2018-02-27 15:45:28.375958754 +0100
+++ ficr-after.rs 2018-02-27 15:44:11.041326001 +0100
@@ -1,413 +1,2311 @@
#[doc = "Factory Information Configuration Registers"]
pub struct FICR {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for FICR {}
impl FICR {
#[doc = r" Returns a pointer to the register block"]
This file has been truncated, but you can view the full file.
# ! [ cfg_attr ( feature = "rt" , feature ( global_asm ) ) ] # ! [ cfg_attr ( feature = "rt" , feature ( macro_reexport ) ) ] # ! [ cfg_attr ( feature = "rt" , feature ( used ) ) ] # ! [ doc = "Peripheral access API for ATSAMD21E15A microcontrollers (generated using svd2rust v0.12.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.12.0/svd2rust/#peripheral-api" ] # ! [ allow ( private_no_mangle_statics ) ] # ! [ deny ( missing_docs ) ] # ! [ deny ( warnings ) ] # ! [ allow ( non_camel_case_types ) ] # ! [ feature ( const_fn ) ] # ! [ no_std ]
extern crate bare_metal;
extern crate cortex_m;
#[macro_reexport(default_handler, exception)]
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
extern crate vcell;
use core::ops::Deref;
use core::marker::PhantomData;
#[doc = r" Number available in the NVIC for configuring priority"]
# ! [ cfg_attr ( feature = "rt" , feature ( global_asm ) ) ] # ! [ cfg_attr ( feature = "rt" , feature ( macro_reexport ) ) ] # ! [ cfg_attr ( feature = "rt" , feature ( used ) ) ] # ! [ doc = "Peripheral access API for LPC43XX microcontrollers (generated using svd2rust v0.12.0)\n\nYou can find an overview of the API [here].\n\n[here]: https://docs.rs/svd2rust/0.12.0/svd2rust/#peripheral-api" ] # ! [ allow ( private_no_mangle_statics ) ] # ! [ deny ( missing_docs ) ] # ! [ deny ( warnings ) ] # ! [ allow ( non_camel_case_types ) ] # ! [ feature ( const_fn ) ] # ! [ feature ( try_from ) ] # ! [ no_std ]
extern crate bare_metal;
extern crate cortex_m;
#[macro_reexport(default_handler, exception)]
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
extern crate vcell;
use core::ops::Deref;
use core::marker::PhantomData;
#[doc = r" Number available in the NVIC for configuring priority"]
➜ tinyrocket git:(james-hack) ✗ ls -hal target/x86_64-unknown-linux-gnu/release/tinyrocket
-rwxr-xr-x 2 james users 1.2M Mar 30 14:53 target/x86_64-unknown-linux-gnu/release/tinyrocket
➜ tinyrocket git:(james-hack) ✗ strip target/x86_64-unknown-linux-gnu/release/tinyrocket
➜ tinyrocket git:(james-hack) ✗ ls -hal target/x86_64-unknown-linux-gnu/release/tinyrocket
-rwxr-xr-x 2 james users 816K Mar 30 14:53 target/x86_64-unknown-linux-gnu/release/tinyrocket
➜ tinyrocket git:(james-hack) ✗ ldd target/x86_64-unknown-linux-gnu/release/tinyrocket
linux-vdso.so.1 (0x00007ffdb3fe8000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fd659240000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007fd659038000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fd658e1a000)
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index ec7d366c3f..421b741a3a 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -1512,6 +1512,18 @@ impl<T: ?Sized> UnsafeCell<T> {
}
}
+// TODO: correct stable attribute
+#[stable(feature = "rust1", since = "1.0.0")]
pub fn new() -> PeripheralX {
// Syntax could look a little like this:
let int_handle = interrupt!(UARTE0_UART0, |mut cons: Consumer| {
// Do some interrupty things here
cons.read();
// ...
});
// Enable the interrupt, but do not pend
int_handle.spawn();
diff --git a/build.rs b/build.rs
index 73d61f7..d7dfb04 100644
--- a/build.rs
+++ b/build.rs
@@ -45,6 +45,7 @@ handlers.");
Build::new().file("exceptions.s").compile("asm");
println!("cargo:rustc-link-search={}", out.display());
+ println!("cargo:rustc-link-lib=static=asm");