1#[macro_export]
2macro_rules! entry {
23 ($robot_type:ty) => {
24 static ROBOT: $crate::once::Once<$crate::robot::Competition<$robot_type>> =
25 $crate::once::Once::new();
26
27 #[no_mangle]
28 unsafe extern "C" fn initialize() {
29 ROBOT.call_once(|| {
30 Competition::new($crate::robot::Robot::new(unsafe {
31 $crate::peripherals::Peripherals::new()
32 }))
33 });
34 }
35
36 #[no_mangle]
37 extern "C" fn opcontrol() {
38 ROBOT.wait().opcontrol();
39 }
40
41 #[no_mangle]
42 extern "C" fn autonomous() {
43 ROBOT.wait().autonomous();
44 }
45
46 #[no_mangle]
47 extern "C" fn disabled() {
48 ROBOT.wait().disabled();
49 }
50 };
51}