aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf52840/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-03-01 01:32:42 +0100
committerDario Nieuwenhuis <[email protected]>2023-03-01 01:32:42 +0100
commit6dbb631f1ecb75361ee70da91f50779c29f23482 (patch)
treed84accfcb94bae68b3983a8a2518689cf868bcc1 /examples/nrf52840/src
parent711ce1014552b715190b1ee6780cafc92fe54240 (diff)
Example fixes.
Diffstat (limited to 'examples/nrf52840/src')
-rw-r--r--examples/nrf52840/src/bin/usb_ethernet.rs23
1 files changed, 0 insertions, 23 deletions
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs
index 430468adf..979780896 100644
--- a/examples/nrf52840/src/bin/usb_ethernet.rs
+++ b/examples/nrf52840/src/bin/usb_ethernet.rs
@@ -46,31 +46,8 @@ async fn net_task(stack: &'static Stack<Device<'static, MTU>>) -> ! {
46 stack.run().await 46 stack.run().await
47} 47}
48 48
49#[inline(never)]
50pub fn test_function() -> (usize, u32, [u32; 2]) {
51 let mut array = [3; 2];
52
53 let mut index = 0;
54 let mut result = 0;
55
56 for x in [1, 2] {
57 if x == 1 {
58 array[1] = 99;
59 } else {
60 index = if x == 2 { 1 } else { 0 };
61
62 // grabs value from array[0], not array[1]
63 result = array[index];
64 }
65 }
66
67 (index, result, array)
68}
69
70#[embassy_executor::main] 49#[embassy_executor::main]
71async fn main(spawner: Spawner) { 50async fn main(spawner: Spawner) {
72 info!("{:?}", test_function());
73
74 let p = embassy_nrf::init(Default::default()); 51 let p = embassy_nrf::init(Default::default());
75 let clock: pac::CLOCK = unsafe { mem::transmute(()) }; 52 let clock: pac::CLOCK = unsafe { mem::transmute(()) };
76 53