Rtos code cntains bug possible incompatability with I2C

Fork of mbed-rtos by mbed official