Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lights fsm working #235

Merged
merged 5 commits into from
Nov 24, 2023
Merged

lights fsm working #235

merged 5 commits into from
Nov 24, 2023

Conversation

devAdhiraj
Copy link
Contributor

No description provided.

uint32_t counter = 1;
pre_loop_init();
TickType_t xLastWakeTime = xTaskGetTickCount();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for moving this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting an FSM TIMEOUT until I moved pre_loop_init(). I feel like maybe pre_loop_init() takes up a long time (inits all pd outputs?) so maybe it is messing up timing which is why it fixed it. But I'm not sure tbh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol I guess that's ok. Would be good to know why though

@@ -27,6 +27,13 @@ typedef void (*SoftTimerCallback)(SoftTimerId id);
// the time has expired.
StatusCode soft_timer_start(uint32_t duration_ms, SoftTimerCallback callback, SoftTimer *timer);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm having multiple functions may confuse people. Perhaps get rid of this one then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to get rid of the original function because its used in a bunch of places and it seems to be working fine for those cases.

switch (light_id_callback) {
case EE_LIGHT_TYPE_SIGNAL_LEFT:
left_signal_state ^= 1;
#ifdef LIGHTS_FSM_DEBUG
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you keeping all these debugs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure if I should, so I added ifdefs around them, but I can just get rid of them to make it cleaner.

@devAdhiraj devAdhiraj force-pushed the lights_fsm_validation branch from c345af9 to cbe8b4b Compare November 19, 2023 02:10
@mitchellostler mitchellostler merged commit db1d27a into main Nov 24, 2023
1 check passed
@mitchellostler mitchellostler deleted the lights_fsm_validation branch November 24, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants