Mbed OS + mbed-events

Hey, so as evidenced by this post:

the minar scheduler seems to be phased out in favor of mbed-events located here: GitHub - ARMmbed/mbed-events: DEPRECATED! This project has moved to mbed-os

This library doesn’t play nice with PIO when tossed into the lib folder. It has some embedded tests which don’t compile. Is my best option to start fiddling with compiler flags and/or forking a version without tests?

Or is there something more elegant that I am missing?

I just noticed library.json for the first time. Would this be the recommended approach?

Does it work when you remove TESTS folder?

It does indeed compile when both TESTS and equeue/tests are removed

Here is docs for library.json manifest. See Redirecting...

Thank you , I will dig into this!

If I’m not the original author of the library, is library.json still the best approach?

library.json allows to control build system. It means, that you can exclude some content from build process. See a hundred libs here PlatformIO Registry , follow to some library that has library.json and click on “Manifest” tab.
For example, PlatformIO Registry

Please library.json to the root of library folder.

{
  "name": "mbed-events",
  "keywords": "queue, event",
  "description": "Flexible and composable queues for scheduling events",
  "repository": {
    "type": "git",
    "url": "https://github.com/ARMmbed/mbed-events.git"
  },
  "frameworks": "mbed",
  "platforms": "*",
  "build": {
    "srcFilter": [
      "+<*.h>",
      "+<*.cpp>"
    ]
  }
}

Does it work?

P.S: @malachib, Thanks a lot for donation!!! :moneybag:

You’re welcome!

the library.json needed the build section changed as follows:

  "build": {
    "srcFilter": [
      "+<*>",
      "-<TESTS/>",
      "-<equeue/tests/>"
    ]
  }

Because compiling equeue folder is important and apparently +<*.h> doesn’t recurse into it.

This does work, but it means I will probably have to fork the repo since I always use git submodules. What do you think? Who knows , maybe they will go for a pull request…

Yes, you fork a repo, create library.json but set repo url to original. In this case, PlatformIO will use only manifest file fo library but source code from original repo.

Got it ~ right, if I recall, for other libs there are “free-floating” github repos just hosting library.json for your crawler to pick up

Yep, platformio-libmirror/configs/mbed at master · platformio/platformio-libmirror · GitHub :blush: