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

Add parameters to check that deck driver have been enabled #237

Closed
ataffanel opened this issue Jul 1, 2017 · 7 comments
Closed

Add parameters to check that deck driver have been enabled #237

ataffanel opened this issue Jul 1, 2017 · 7 comments

Comments

@ataffanel
Copy link
Member

It would be useful for diverse client to be able to check that a deck driver has been enabled or not.

Today this is done in the PC client checking for the presence of the one-wire memory contained in the decks but being able to check for driver initialization would also allow to check a manually enabled driver.

Doing so with parameters is also easier to use than parsing the one wire memories.

The proposal is to have one read only parameter per driver with the name "deck.". The content is a boolean, 1 for initialized, 0 for not initialized.

@fredg02
Copy link
Member

fredg02 commented Nov 3, 2017

I noticed that driver initialization seems to be independent from the actual existence of a deck. For example, the deck driver for the zRanger is initialized even when the deck is not actually connected. This is in line with the description in this bug, but not expected by the user, I think

Is this working as intended or is this a bug?.

@krichardsson
Copy link
Contributor

@fredg02 , that is not the intention. Only drivers for decks that are detected or drivers that are forced using the compile flag (like CFLAGS += -DDECK_FORCE=bcZRanger in config.mk) should be initialized.

Can you describe how to reproduce it?

@fredg02
Copy link
Member

fredg02 commented Nov 3, 2017

I used the Python client to connect to a CF2 without a zRanger or Flow deck. In the parameters tab the deck.bcZRanger parameter showed "1", when it should have showed "0".

Tested with the latest firmware (built from master).

@krichardsson
Copy link
Contributor

Yes, that sounds like the z-ranger driver has been initialized, the question is why.
I can not see the same behaviour on my CF with (more or less) the same FW. Is the firmware a clean build without any flags set in config.mk?

@fredg02
Copy link
Member

fredg02 commented Nov 3, 2017

AFAIK it was a clean build, but I will do some more testing to isolate/reproduce the problem.

@fredg02
Copy link
Member

fredg02 commented Nov 7, 2017

OK. So apparently I don't know how visibility of global variables in C works. :(
Deck initialization works as expected, but I was testing a new parameter for the buzzer deck and used the isInit variable, which is also used by the zranger.c class. That caused the issue I was seeing. Sorry for the noise.

fredg02 added a commit to fredg02/crazyflie-firmware that referenced this issue Nov 7, 2017
@krichardsson
Copy link
Contributor

@fredg02 The isInit should have been static to avoid interference with other modules. Fixed in #262

krichardsson added a commit that referenced this issue Nov 9, 2017
Add buzzer deck init parameter (#237)
fredg02 added a commit to fredg02/crazyflie-firmware that referenced this issue Nov 10, 2017
krichardsson added a commit that referenced this issue Nov 10, 2017
Add deck parameter for BigQuad, Flow, OA and LED ring deck (#237)
@krichardsson krichardsson added this to the next-version milestone Nov 16, 2017
@ataffanel ataffanel removed this from the next-version milestone Jan 22, 2018
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

No branches or pull requests

3 participants