mirror of https://github.com/ARMmbed/mbed-os.git
parent
5480969d14
commit
8701e0f4c4
File diff suppressed because it is too large
Load Diff
|
@ -1,21 +1,21 @@
|
|||
{
|
||||
"name": "minimal-printf",
|
||||
"config": {
|
||||
"enable-floating-point": {
|
||||
"help": "Enable floating point printing",
|
||||
"value": false
|
||||
},
|
||||
"set-floating-point-max-decimals": {
|
||||
"help": "Maximum number of decimals to be printed",
|
||||
"value": 6
|
||||
},
|
||||
"enable-64-bit": {
|
||||
"help": "Enable printing 64 bit integers",
|
||||
"value": true
|
||||
},
|
||||
"console-output": {
|
||||
"help": "Console output. Options: UART, SWO",
|
||||
"value": "UART"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "minimal-printf",
|
||||
"config": {
|
||||
"enable-floating-point": {
|
||||
"help": "Enable floating point printing",
|
||||
"value": false
|
||||
},
|
||||
"set-floating-point-max-decimals": {
|
||||
"help": "Maximum number of decimals to be printed",
|
||||
"value": 6
|
||||
},
|
||||
"enable-64-bit": {
|
||||
"help": "Enable printing 64 bit integers",
|
||||
"value": true
|
||||
},
|
||||
"console-output": {
|
||||
"help": "Console output. Options: UART, SWO",
|
||||
"value": "UART"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2016 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MBED_PRINTF_H
|
||||
#define MBED_PRINTF_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Minimal printf
|
||||
*
|
||||
* Prints directly to stdio/UART without using malloc.
|
||||
*/
|
||||
int mbed_printf(const char *format, ...);
|
||||
|
||||
/**
|
||||
* Minimal snprintf
|
||||
*
|
||||
* Prints directly to buffer without using malloc.
|
||||
*/
|
||||
int mbed_snprintf(char* buffer, size_t length, const char* format, ...);
|
||||
|
||||
/**
|
||||
* Minimal printf
|
||||
*
|
||||
* Prints directly to stdio/UART without using malloc.
|
||||
*/
|
||||
int mbed_vprintf(const char* format, va_list arguments);
|
||||
|
||||
/**
|
||||
* Minimal snprintf
|
||||
*
|
||||
* Prints directly to buffer without using malloc.
|
||||
*/
|
||||
int mbed_vsnprintf(char* buffer, size_t length, const char* format, va_list arguments);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MBED_PRINTF_H
|
||||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2016 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef MBED_PRINTF_H
|
||||
#define MBED_PRINTF_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Minimal printf
|
||||
*
|
||||
* Prints directly to stdio/UART without using malloc.
|
||||
*/
|
||||
int mbed_printf(const char *format, ...);
|
||||
|
||||
/**
|
||||
* Minimal snprintf
|
||||
*
|
||||
* Prints directly to buffer without using malloc.
|
||||
*/
|
||||
int mbed_snprintf(char* buffer, size_t length, const char* format, ...);
|
||||
|
||||
/**
|
||||
* Minimal printf
|
||||
*
|
||||
* Prints directly to stdio/UART without using malloc.
|
||||
*/
|
||||
int mbed_vprintf(const char* format, va_list arguments);
|
||||
|
||||
/**
|
||||
* Minimal snprintf
|
||||
*
|
||||
* Prints directly to buffer without using malloc.
|
||||
*/
|
||||
int mbed_vsnprintf(char* buffer, size_t length, const char* format, va_list arguments);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MBED_PRINTF_H
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int mbed_minimal_formatted_string(char* buffer, size_t length, const char* format, va_list arguments);
|
||||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int mbed_minimal_formatted_string(char* buffer, size_t length, const char* format, va_list arguments);
|
||||
|
|
|
@ -1,79 +1,79 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "mbed_printf_implementation.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(TOOLCHAIN_GCC)
|
||||
#define SUB_PRINTF __wrap_printf
|
||||
#define SUB_SNPRINTF __wrap_snprintf
|
||||
#define SUB_SPRINTF __wrap_sprintf
|
||||
#define SUB_VSNPRINTF __wrap_vsnprintf
|
||||
#elif defined(TOOLCHAIN_ARM)
|
||||
#define SUPER_PRINTF $Super$$printf
|
||||
#define SUB_PRINTF $Sub$$printf
|
||||
#define SUPER_SNPRINTF $Super$$snprintf
|
||||
#define SUB_SNPRINTF $Sub$$snprintf
|
||||
#define SUPER_SPRINTF $Super$$sprintf
|
||||
#define SUB_SPRINTF $Sub$$sprintf
|
||||
#define SUPER_VSNPRINTF $Super$$vsnprintf
|
||||
#define SUB_VSNPRINTF $Sub$$vsnprintf
|
||||
#elif defined(__ICCARM__)
|
||||
#define SUPER_PRINTF $Super$$__iar_printf
|
||||
#define SUB_PRINTF $Sub$$__iar_printf
|
||||
#define SUPER_SNPRINTF $Super$$__iar_snprintf
|
||||
#define SUB_SNPRINTF $Sub$$__iar_snprintf
|
||||
#define SUPER_SPRINTF $Super$$__iar_sprintf
|
||||
#define SUB_SPRINTF $Sub$$__iar_sprintf
|
||||
#define SUPER_VSNPRINTF $Super$$__iar_vsnprintf
|
||||
#define SUB_VSNPRINTF $Sub$$__iar_vsnprintf
|
||||
#endif
|
||||
|
||||
int SUB_PRINTF(const char *format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(NULL, LONG_MAX, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_SNPRINTF(char* buffer, size_t length, const char* format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(buffer, length, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_SPRINTF(char* buffer, const char* format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(buffer, LONG_MAX, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_VSNPRINTF(char* buffer, size_t length, const char* format, va_list arguments)
|
||||
{
|
||||
return mbed_minimal_formatted_string(buffer, length, format, arguments);
|
||||
}
|
||||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "mbed_printf_implementation.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(TOOLCHAIN_GCC)
|
||||
#define SUB_PRINTF __wrap_printf
|
||||
#define SUB_SNPRINTF __wrap_snprintf
|
||||
#define SUB_SPRINTF __wrap_sprintf
|
||||
#define SUB_VSNPRINTF __wrap_vsnprintf
|
||||
#elif defined(TOOLCHAIN_ARM)
|
||||
#define SUPER_PRINTF $Super$$printf
|
||||
#define SUB_PRINTF $Sub$$printf
|
||||
#define SUPER_SNPRINTF $Super$$snprintf
|
||||
#define SUB_SNPRINTF $Sub$$snprintf
|
||||
#define SUPER_SPRINTF $Super$$sprintf
|
||||
#define SUB_SPRINTF $Sub$$sprintf
|
||||
#define SUPER_VSNPRINTF $Super$$vsnprintf
|
||||
#define SUB_VSNPRINTF $Sub$$vsnprintf
|
||||
#elif defined(__ICCARM__)
|
||||
#define SUPER_PRINTF $Super$$__iar_printf
|
||||
#define SUB_PRINTF $Sub$$__iar_printf
|
||||
#define SUPER_SNPRINTF $Super$$__iar_snprintf
|
||||
#define SUB_SNPRINTF $Sub$$__iar_snprintf
|
||||
#define SUPER_SPRINTF $Super$$__iar_sprintf
|
||||
#define SUB_SPRINTF $Sub$$__iar_sprintf
|
||||
#define SUPER_VSNPRINTF $Super$$__iar_vsnprintf
|
||||
#define SUB_VSNPRINTF $Sub$$__iar_vsnprintf
|
||||
#endif
|
||||
|
||||
int SUB_PRINTF(const char *format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(NULL, LONG_MAX, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_SNPRINTF(char* buffer, size_t length, const char* format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(buffer, length, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_SPRINTF(char* buffer, const char* format, ...)
|
||||
{
|
||||
va_list arguments;
|
||||
va_start(arguments, format);
|
||||
int result = mbed_minimal_formatted_string(buffer, LONG_MAX, format, arguments);
|
||||
va_end(arguments);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int SUB_VSNPRINTF(char* buffer, size_t length, const char* format, va_list arguments)
|
||||
{
|
||||
return mbed_minimal_formatted_string(buffer, length, format, arguments);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue