The first generation of devices I am working on at Ephemeron Labs includes the Making Things board as our first processor. The core of the previous code was (hastily) designed to run raw on the core of the AT91SAM7x256 chip. Because of this there are some minor problems, such as the serial Buffer being overwritten during transmission because it doesn’t have semaphores.

So naturally, when I go to add some seamphores, I’m not going to try to reinvent the wheel. Instead I went to FreeRTOS and MakingThings codebase and tried to grab their semaphore implementation, and the related code needed for it to run.

After looking around a bit, it gets down to the question how to integrate into older and more complete codebase. Do I rewrite for FreeRTOS? Do I sync with the MakingThings framework, and extend that to meet our needs? Or should I selectively branch the few tools I need into our codebase?

My first instinct was to branch the existing UsbSerial codebase into my stripped down system. Because of the underlying implementation, my function calls and behaviour line up 1-to-1 to the MakeingThings usbSerial code. Unfortunately that is drawing in a lot of other code and dependencies. After a couple of hours down that path, it’s looking more frustrating that I first thought. For now, I’m back to the drawing board (and reading code) to decide the best approach.