From a5b6afb1b12e7ed64353c680e0caa4fb58a9ee1d Mon Sep 17 00:00:00 2001 From: Jan Breuer <jan.breuer@jaybee.cz> Date: 周日, 24 4月 2016 16:29:55 +0800 Subject: [PATCH] Just code formatting --- libscpi/inc/scpi/config.h | 36 +++++++++++++++++++++++++++++++++--- 1 files changed, 33 insertions(+), 3 deletions(-) diff --git a/libscpi/inc/scpi/config.h b/libscpi/inc/scpi/config.h index 6371bb0..94bf67d 100644 --- a/libscpi/inc/scpi/config.h +++ b/libscpi/inc/scpi/config.h @@ -89,6 +89,15 @@ #define USE_USER_ERROR_LIST 0 #endif +#ifndef USE_DEVICE_DEPENDENT_ERROR_INFORMATION +#define USE_DEVICE_DEPENDENT_ERROR_INFORMATION 0 +#ifndef USE_MEMORY_ALLOCATION_FREE +#define USE_MEMORY_ALLOCATION_FREE 1 +#endif +#endif + + + #ifndef USE_COMMAND_TAGS #define USE_COMMAND_TAGS 1 #endif @@ -109,8 +118,8 @@ #define USE_UNITS_ANGLE SYSTEM_TYPE #endif -#ifndef USE_UNITS_PARICLES -#define USE_UNITS_PARICLES SYSTEM_TYPE +#ifndef USE_UNITS_PARTICLES +#define USE_UNITS_PARTICLES SYSTEM_TYPE #endif #ifndef USE_UNITS_DISTANCE @@ -190,8 +199,10 @@ /* PIC32mx */ #if defined(__C32__) #define HAVE_STRNLEN 0 -#define HAVE_STRNCASECMP 1 +#define HAVE_STRNCASECMP 0 #define HAVE_STRNICMP 0 +#define isfinite finite +#define signbit(x) ((x)<0) #endif /* AVR libc */ @@ -249,6 +260,25 @@ #define SCPIDEFINE_doubleToStr(v, s, l) snprintf((s), (l), "%.15lg", (v)) #endif +#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION + +#if USE_MEMORY_ALLOCATION_FREE +#include <stdlib.h> +#include <string.h> +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 2 +#define SCPIDEFINE_strdup(h, s) strdup((s)) +#define SCPIDEFINE_free(h, s, r) free((s)) +#else +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 3 +#define SCPIDEFINE_strdup(h, s) OUR_strdup((h), (s)) +#define SCPIDEFINE_free(h, s, r) OUR_free((h), (s), (r)) +#define SCPIDEFINE_get_parts(h, s, l1, s2, l2) OUR_get_parts((h), (s), (l1), (s2), (l2)) +#endif +#else +#define SCPIDEFINE_DESCRIPTION_MAX_PARTS 1 +#define SCPIDEFINE_strdup(h, s) NULL +#define SCPIDEFINE_free(h, s, r) (void) +#endif #ifdef __cplusplus } -- Gitblit v1.9.1