Skip to content

Commit 91c5644

Browse files
committed
Integrate StrPrintf utilities into build
This patch provides a header file for the StrPrint functions and integrates the source file into the build.
1 parent a71a6ff commit 91c5644

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ DRIVERLIB = $(SDK_PATH)/driverlib
5050
OSLIB = $(SDK_PATH)/oslib
5151
FREERTOS = $(SDK_PATH)/third_party/FreeRTOS
5252
COMMON = $(SDK_PATH)/example/common
53+
STR = external/str
5354

5455
CPPFLAGS += $(DEFINES) $(INC)
5556
CFLAGS += -Os -ffunction-sections -fdata-sections -Wall -std=c11
@@ -63,6 +64,7 @@ INC += -I$(FREERTOS)/source
6364
INC += -I$(FREERTOS)/source/include
6465
INC += -I$(FREERTOS)/source/portable/GCC/ARM_CM4
6566
INC += -I$(COMMON)
67+
INC += -I$(STR)
6668

6769
LIBS =
6870

@@ -124,6 +126,10 @@ OBJ += $(addprefix $(OBJDIR)/$(DRIVERLIB)/, \
124126
wdt.o \
125127
)
126128

129+
OBJ += $(addprefix $(OBJDIR)/$(STR)/, \
130+
StrPrintf.o \
131+
)
132+
127133
.PHONY: all
128134
all: $(TARGET)
129135

external/str/StrPrintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
/* ---- Include Files ---------------------------------------------------- */
3737

38-
#include "Str.h"
38+
#include "StrPrintf.h"
3939
#include <limits.h>
4040
#include <string.h>
4141

external/str/StrPrintf.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
* http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
#pragma once
5+
6+
#include <stdarg.h>
7+
8+
typedef int (*StrXPrintfFunc)(void *outParm, int c);
9+
10+
int
11+
StrPrintf(char* outStr, int maxLen, const char* fmt, ...);
12+
13+
int
14+
StrXPrintf(StrXPrintfFunc outFunc, void* outParm, const char* fmt, ...);
15+
16+
int
17+
vStrPrintf(char* outStr, int maxLen, const char* fmt, va_list args);
18+
19+
int
20+
vStrXPrintf(StrXPrintfFunc outFunc,void* outParm, const char* fmt,
21+
va_list args);

0 commit comments

Comments
 (0)