Skip to content

Commit

Permalink
Merge pull request #459 from lf-lang/modes-with-microsteps
Browse files Browse the repository at this point in the history
Increment tag after mode switch rather than set to 1
  • Loading branch information
edwardalee authored Jun 29, 2024
2 parents d22db97 + 5ac0a0b commit 7f97bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/modal_models/modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ void _lf_process_mode_changes(environment_t* env, reactor_mode_state_t* states[]
if (env->modes->triggered_reactions_request) {
// Insert a dummy event in the event queue for the next microstep to make
// sure startup/reset reactions (if any) are triggered as soon as possible.
tag_t dummy_event_tag = (tag_t){.time = env->current_tag.time, .microstep = 1};
tag_t dummy_event_tag = (tag_t){.time = env->current_tag.time, .microstep = env->current_tag.microstep + 1};
pqueue_tag_insert(env->event_q, (pqueue_tag_element_t*)_lf_create_dummy_events(env, dummy_event_tag));
}
}
Expand Down

0 comments on commit 7f97bd9

Please sign in to comment.