GithubHelp home page GithubHelp logo

easyblack's People

Contributors

facine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

easyblack's Issues

static initialization problems... and suggested fix...

Hi there,

I am running into static initialization order issues with this library in its current form (aka the "Static initialization order fiasco" see: https://isocpp.org/wiki/faq/ctors#static-init-order ).

I was able to fix it in my case by converting the following variables to the "Construct On First Use Idiom" (described just below the above link, on the same page): PIN_INDEX, BSPM_TEMPLATE and BSPWM_TEMPLATE.

The fix (which worked for me) is below, and won't affect the function of the library, just make it more portable/predictable across different compilers. Essentially it just enforces a functional initialization order.

In the memGPIO.cpp:

add the following instead of the current static initialization of the above variables:

const std::map<std::string, const memGPIO::gpioPin> &memGPIO::PIN_INDEX() {
  static const std::map<std::string, const memGPIO::gpioPin> *index = new std::map<std::string, const memGPIO::gpioPin>(memGPIO::initializePins());
  return *index;
}
const std::string &memGPIO::BSPM_TEMPLATE()
{
  static const std::string *tmpl = new std::string(memGPIO::initializeBSPMTemplate());
  return *tmpl;
}
const std::string &memGPIO::BSPWM_TEMPLATE()
{
  static const std::string *tmpl = new std::string( memGPIO::initializeBSPWMTemplate());
  return *tmpl;
}

In memGPIO.hpp, replace the variable declarations with the following function declarations:

  // Available PINs.
  static const std::map <std::string, const gpioPin> &PIN_INDEX();

  // DTS file templates.
  static const std::string &BSPM_TEMPLATE();
  static const std::string &BSPWM_TEMPLATE();

Finally, in memGPIO.cpp, replace all uses of PIN_INDEX with PIN_INDEX(), BSPM_TEMPLATE with BSPM_TEMPLATE(), and PSPWM_TEMPLATE with PSPWM_TEMPLATE().

External interrupts handling

Hello,
I was wondering either you are planning on adding external interrupts handling on pins in your library? That feature would help me a lot right now and I think its a great feature in general. I would aprichiate some info :).

nullptr for arm-linux-gnueabihf-g++

Hello there,
I would like to use your library in my project. I am using QT Creator and arm-linux-gnueabihf-g++ (gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux) for compiling and deploying programs to BeagleBone Black. The problem I faced is that my compiller doesnt know the nullptr. Could you please tell me what version are you using?

BBB Freezing

Hello Facine,
I have a problem with your library. In my project I need to use GPIO to send aproximetly 60 Clock signals as fast as possible once per minute. Problem is, that beaglebone stops after about 3-4 hours of work (Can't connect by usb/eth, gpio not working). I tried to clean cache and bufffer cyclically every 5minutes and tried to use watchdog but without any effect. When I was using older library (iolib from element14 forum) there was no such issue. I would be greatful for any help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.