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

Move mraa_i2c_mode_t from types.h to i2c.h #157

Open
eschaton opened this issue Mar 9, 2015 · 2 comments
Open

Move mraa_i2c_mode_t from types.h to i2c.h #157

eschaton opened this issue Mar 9, 2015 · 2 comments

Comments

@eschaton
Copy link

eschaton commented Mar 9, 2015

The header <mraa/types.h> purports to be for basic shared types, but it contains an i2c-specific type, mraa_i2c_mode_t. That should really be in <mraa/i2c.h> instead.

This would be equivalent to what <mraa/spi.h> does with mraa_spi_mode_t.

@arfoll
Copy link
Contributor

arfoll commented Mar 9, 2015

Agreed, the struct should 'ideally' be duplicated in the C++ header and the C header so that SWIG uses the correct name. The reason for throwing it in the types.h is that swig takes that file (but not i2c.h) and will strip the prefix away (since we have the namespace/module/package name). So it really depends on whether you prefer enum duplication or things in the right place :) I'm happy to take a PR to change this.

@eschaton
Copy link
Author

eschaton commented Mar 9, 2015

I can't submit a PR, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants