diff --git a/packages/pros-async/src/lib.rs b/packages/pros-async/src/lib.rs index 6d1beb30..004a082f 100644 --- a/packages/pros-async/src/lib.rs +++ b/packages/pros-async/src/lib.rs @@ -185,8 +185,9 @@ macro_rules! async_robot { #[no_mangle] extern "C" fn initialize() { + let robot = Default::default(); unsafe { - ROBOT = Some(Default::default()); + ROBOT = Some(robot); } } }; @@ -195,8 +196,9 @@ macro_rules! async_robot { #[no_mangle] extern "C" fn initialize() { + let robot = $init; unsafe { - ROBOT = Some($init); + ROBOT = Some(robot); } } }; diff --git a/packages/pros-sync/src/lib.rs b/packages/pros-sync/src/lib.rs index 6f7df18a..6c252308 100644 --- a/packages/pros-sync/src/lib.rs +++ b/packages/pros-sync/src/lib.rs @@ -123,8 +123,9 @@ macro_rules! sync_robot { #[no_mangle] extern "C" fn initialize() { + let robot = Default::default(); unsafe { - ROBOT = Some(Default::default()); + ROBOT = Some(robot); } } }; @@ -133,8 +134,9 @@ macro_rules! sync_robot { #[no_mangle] extern "C" fn initialize() { + let robot = $init; unsafe { - ROBOT = Some($init); + ROBOT = Some(robot); } } };