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

Nl replaced sync library #16

Merged
merged 9 commits into from
Jun 11, 2014
Merged

Nl replaced sync library #16

merged 9 commits into from
Jun 11, 2014

Conversation

nlintz
Copy link
Contributor

@nlintz nlintz commented Jun 11, 2014

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

@nlintz nlintz mentioned this pull request Jun 11, 2014

var DEBUG = false;
var COMPRESSION_RANGE = 255;

var queue = new Queue();
Copy link
Contributor

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.

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 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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

queue is part of camera object now.

image

@johnnyman727
Copy link
Contributor

r+

johnnyman727 added a commit that referenced this pull request Jun 11, 2014
@johnnyman727 johnnyman727 merged commit c43202a into master Jun 11, 2014
@johnnyman727 johnnyman727 deleted the nl-replaced-sync-library branch June 11, 2014 02:42
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.

2 participants