aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/baremetal/mod.rs6
-rw-r--r--src/main.rs18
2 files changed, 24 insertions, 0 deletions
diff --git a/src/baremetal/mod.rs b/src/baremetal/mod.rs
new file mode 100644
index 000000000..c03b9538b
--- /dev/null
+++ b/src/baremetal/mod.rs
@@ -0,0 +1,6 @@
1use core::panic::PanicInfo;
2
3#[panic_handler]
4fn panic(_info: &PanicInfo) -> ! {
5 loop {}
6}
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 000000000..7111536ff
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,18 @@
1#![cfg_attr(target_os = "none", no_std)]
2#![cfg_attr(target_os = "none", no_main)]
3
4#[cfg(target_os = "none")]
5mod baremetal;
6
7#[cfg(not(target_os = "none"))]
8fn main() {
9 println!("Hello, world!");
10}
11
12#[cfg(test)]
13mod tests {
14 #[test]
15 fn it_works() {
16 assert_eq!(2 + 2, 4);
17 }
18}