mbed library sources. Supersedes mbed-src. Fixes analogIn and analogOut problems for TARGET_STM32F3. Tested on NUCLEO-F303K8, using 3 analogout and 7 analogin channels simultaneously. Added ability for STM32F334R8 and STM32F303K8 to use all three channels of DAC simultaneously. https://developer.mbed.org/users/StevieWray/code/mbed-dev/ Added ability for TARGET_STM32F3 to use more than one ADC simultaneously. https://developer.mbed.org/questions/67997/NUCLEO-F303K8ADC/
Fork of mbed-dev by
Diff: common/RawSerial.cpp
- Revision:
- 47:e32b5dd8af6d
- Parent:
- 0:9b334a45a8ff
--- a/common/RawSerial.cpp Mon Jan 11 09:45:10 2016 +0000 +++ b/common/RawSerial.cpp Mon Jan 11 17:00:10 2016 +0000 @@ -47,7 +47,10 @@ int RawSerial::printf(const char *format, ...) { std::va_list arg; va_start(arg, format); - int len = vsnprintf(NULL, 0, format, arg); + // ARMCC microlib does not properly handle a size of 0. + // As a workaround supply a dummy buffer with a size of 1. + char dummy_buf[1]; + int len = vsnprintf(dummy_buf, sizeof(dummy_buf), format, arg); if (len < STRING_STACK_LIMIT) { char temp[STRING_STACK_LIMIT]; vsprintf(temp, format, arg);