-
Notifications
You must be signed in to change notification settings - Fork 40
Moved startTracking() call to setup() #49
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
base: main
Are you sure you want to change the base?
Moved startTracking() call to setup() #49
Conversation
| print_out("Starting uart task"); | ||
| } | ||
|
|
||
| // Start tracking axis now that pins and UART is initialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally i would move this init code to a new freertos task and execute the tracking before the loop.
This way its ensured that that the setup sets everything up prior executing any work. The trackingrate and direction should then also be retrievable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting to move all of the pin initialization to a task, or just startTracking(). None of that code is long running as far as I understand, so is a task needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not long running yes, but it opens doors for future feature implementation as it groups certain functions with their dedicated time slot of execution. Everyhing that should be initialized prior the scheduler takes control of the numerous work should be done in the setup(). startTracking is something that i expect the system to do when everything init related is done and can now "do the real work".
Sylensky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Initialize Wifi and web server | ||
| setupWireless(); | ||
| // Start tracking axis now that pins and UART is initialized | ||
| setupTracking(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call the setupTracking() in the trackerTask prior the loop.
Also the setupWireless() should happen befor the tasks are created. The previous position in the code for it was better.
| // Initialize Wifi and web server | ||
| setupWireless(); | ||
|
|
||
| if (xTaskCreate(intervalometerTask, "intervalometerTask", 4096, NULL, 1, NULL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work as it creates the same task that already exists. rename it to trackingTask with the corresponding entry function. Have a look at the other tasks on how they are added, should be fairly simple to add it.
| print_out("Starting uart task"); | ||
| } | ||
|
|
||
| // Start tracking axis now that pins and UART is initialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not long running yes, but it opens doors for future feature implementation as it groups certain functions with their dedicated time slot of execution. Everyhing that should be initialized prior the scheduler takes control of the numerous work should be done in the setup(). startTracking is something that i expect the system to do when everything init related is done and can now "do the real work".
|
Any update on this PR @DjofPlusPlus? Please rebase your PR on the |
|
I'm currently abroad away from the hardware. |
I'm working with a OG v1. In my setup I was getting tracking rotation in the wrong direction. I found this to be due to pin initialization in
setup()occurring after the code in the staticAxis ra_axisconstructor had executed, withsetDirectionfailing. For the same reason, outputting to UART was also failing since it's initialized insetup()as well.Moving the
startTracking()call to setup resolved these issues.