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

Updated to work on all revisions (Rev1, Rev2, B+ and above) #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aichan
Copy link

@Aichan Aichan commented Apr 24, 2015

Removed RaspberryPinNumber as it was confusing (to me) feel free to add it again.

BroadcomPinNumber is now "private" as you could not write portable code with it + numbering was confusing (0,1,21 became 2,3,27 after Rev1)

PhysicalPinNumber now abstracts BroadcomPinNumber detecting the Raspberry Pi revision type

- Removed BroadcomPinNumber no longer public as this numbering was confusing, PhysicalPinNumber is now abstracting it fully
@andycb
Copy link
Owner

andycb commented Apr 26, 2015

Thanks for this. Some (minor and hopefully constructive) feedback:

  • I think you're right to remove RaspberryPinNumber, I seem to remember when I first made this, there were several ways to addressing the Pin numbers, but I don’t see anybody using this system anymore, nor can I find a pin out diagram with them on.

  • Your method of detecting the Pi revision will not work with Windows. OSx or non Linux systems. Please can you add a safe default if the code is in Test mode, running on a non-Lunix platform and if the detection fails on a non-pi Linux install?

  • Was it necessary to wrap BroadcomPinNumber in a PartalClass of LibGpio? Given that LibGpio is always consumed as a separate assembly, would making BroadcomPinNumber internal not have been a cleaner way of removing it from the public interface?

  • Unfortunately, this breaks a lot of the documentation and the demos, but I don't think that's a huge concern right now.

  • Ideally GpioLayout.cs would have a copyright header similar to….

    //-----------------------------------------------------------------------
    //
    // Copyright (C) 2015 Andrew Bradford and contributors - see https://github.com/andycb/PiSharp/graphs/contributors
    //
    // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
    // associated documentation files (the "Software"), to deal in the Software without restriction,
    // including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
    // and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject
    // to the following conditions:
    //
    // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    //
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    //
    //-----------------------------------------------------------------------

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