Embedded software developers normally prefer to use a pure C, however in some cases and especially in complex projects using C++ gives a more clear structured implementation. Unfortunately, by default C++ compiler produces pretty big binaries. This can be acceptable in case of a normal OS with a big amount of memory, but things are getting complicated when it comes to microcontrollers. I played a bit with compiler and linker options and it seems that the most size-consuming options CPP features are RTTI (run-time type information) and exceptions. I strongly believe that these are not things you can’t live without. So, I came up with the following configuration (valid for GCC toolchain):
Flag | Description |
---|---|
-fno-rtti | (Don’t generate run-time typed identification) |
-fno-exceptions | (Don’t catch exceptions) |
Flag | Description |
---|---|
-flto | (Use link time optimization) |
-lstdc++ | Use C++ libraries. You use them, right? |
Resulting binary size is pretty small and comparable with the equivalent C compiler output. Of course, you can reduce the size even more, but flags above are the most effective.
Repo is a wonderful tool which simplifies my daily work across multiple Git repositories.
One of the most useful commands in my opinion is repo forall
.
However, it does not show project name before performing a command on a specific repository.
There is a -p
parameter, which does exactly what I need, but some part of the output seems to be missing (at least in my case with 50+ repositories).
After playing a bit around command-line parameters I came up with a simple solution. Just add the following to your bash alias list:
repo_forall () { repo forall -c "echo -e \"\\e[32m\"\$REPO_PROJECT\"\\e[39m\"; $@" ;}
After that just pass the command to this function:
repo_forall "git branch"
Here is a sample output:
If you use Deluge WebUI then from time to time you have to enter your password and select default connection in the connection manager. It could be a bit annoying, especially if you use your own local server (e.g. OpenMediaVault) and do not expose WebUI to the external world. Of course, you can use a workaround and avoid direct interaction with WebUI. For example, Transdrone is a good Android interface, which can connect to Deluge using your WebUI password. Looks good, but it’s much better just to remove these annoying windows. In this post you’ll find a step-by-step instruction.