/* 'Light Slot Machine' Lane */ CALLSET_ENTRY (lanes, sw_left_inlane_2) { if (!lamp_test (LM_LEFT_INLANE2) && spiralaward_set_completed == FALSE) { callset_invoke(start_spiralaward_timer); } lamp_on (LM_LEFT_INLANE2); check_rollover (); score (SC_1K); event_can_follow (left_inlane_2, right_loop, TIME_3S); }
uint64_t time_get_ticks() { uint64_t result; // keep calculating result until it is calculated without a rollover having // happened { CriticalSection cs; do { result = (rollovers << 24) | (0xffffff - systick_get_value()); } while(check_rollover()); } return result; }
uint64_t time_get_ns() { uint64_t result; // keep calculating result until it is calculated without a rollover having // happened cm_disable_interrupts(); do { result = (rollovers << 24) | (0xffffff - systick_get_value()); } while(check_rollover()); cm_enable_interrupts(); return result*125/9; }
/* 'Dead End' Lane */ CALLSET_ENTRY (lanes, sw_right_inlane) { event_can_follow (left_or_right_inlane, either_outlane, TIME_1S); lamp_on (LM_RIGHT_INLANE); check_rollover (); score (SC_1K); /* Light Dead end if not lit */ lamp_on (LM_DEAD_END); timer_restart_free (GID_TNF_READY, TIME_4S); //event_can_follow (right_inlane, left_ramp, TIME_4S); }
/* 'Light Spiral' Lane */ CALLSET_ENTRY (lanes, sw_left_inlane_1) { event_can_follow (left_or_right_inlane, either_outlane, TIME_1S); /* Start the spiralaward timer only if the lane has * just been lit */ if (!lamp_test (LM_LEFT_INLANE1) && spiralaward_set_completed == FALSE) { callset_invoke (start_spiralaward_timer); } lamp_on (LM_LEFT_INLANE1); check_rollover (); score (SC_1K); event_can_follow (left_inlane_1, right_loop, TIME_3S); }
void sys_tick_handler(void) { { CriticalSection cs; check_rollover(); } }
void sys_tick_handler(void) { cm_disable_interrupts(); check_rollover(); cm_enable_interrupts(); }