“Write once and use everywhere” is the goal of component-based development. In my opinion, mbed OS utilizes modules to head towards that goal. However, sometimes I need to customize existing module(s) to meet my needs, but I could not find a feasible way to achieve that.
For example, the retarget.cpp of mbed-drivers implements the the low-level _write function to re-direct the debug messages to the serial port, but its speed is slow. On the contrary, Segger RTT could output debugging messages with very high performance. To use Segger RTT, I also need to re-implement the low level _write function. The end result is that I need a customized version of mbed-dirvers to disable the _write function in order to utilize Segger RTT.
To use the customized mbed-dirvers for my executable, I could use yotta link command to link to it. But how do I share the source of the executable to others to successfully build that executable? If they build the executable without using yotta link, yotta will pull mbed-drivers from the yotta registry.
How does mbed OS to solve this kind of problem?