Unify the source code between arduino and mbed