-
Notifications
You must be signed in to change notification settings - Fork 4
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
Nl replaced sync library #16
Conversation
|
||
var DEBUG = false; | ||
var COMPRESSION_RANGE = 255; | ||
|
||
var queue = new Queue(); |
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 seems like this queue should be a property of the Camera object, right? Each port as a different UART bus so those signals can't interfere with each other and the SPI bus has a queue of its own.
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.
I agree. I was wondering about the SPI bus stuff tho. If there is a shared spi bus then I think that each camera instance should share the same queue otherwise two instances might call take picture at the same time and cause issues. What are your thoughts?
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.
We have a SPI queue in the Tessel driver that should prevent that from happening. If a SPI request is already underway, the second call to takePicture
would be queued up until the first completes.
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.
Other than that, works well! r+ after moving queue inside the object.
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.
Noice! Thats good thinking building an internal SPI queue.
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.
r+ |
Replaced the sync-q library with my own synchronous queue library named - sink_q
Race conditions are fixed so users can call take picture without manually interleaving callbacks
Reviewed By: @johnnyman727