🎉 feat(init repo): first update the repo

初次提交仓库
  1. 添加源文件和仓库的必要配置文件
  2. 添加readme
end of segment
This commit is contained in:
Alvin Young 2022-08-23 23:30:21 +08:00
commit bffcf038e7
5 changed files with 85 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
build/
bin/
obj/
.vscode/
*.o

0
cmd_decoder.c Normal file
View File

38
cmd_decoder.h Normal file
View File

@ -0,0 +1,38 @@
/**
* @file cmd_decoder.h
* @author impressionyang (impressionyang@outlook.com)
* @brief
* @version 0.1
* @date 2022-08-23
*
* @copyright Copyright (c) 2022 impressionyang
*
* @par :
* <table>
* <tr><th>Date <th>Version <th>Author <th>Description
* <tr><td>2022-08-23 <td>v1.0 <td>impressionyang <td>
* </table>
*/
#ifndef __CMD_DECODER_H__
#define __CMD_DECODER_H__
#include <stdint.h>
#ifdef __cplusplus ///<use C compiler
extern "C"
{
#endif
typedef struct _cmd_decoder_
{
/// 使能标志,确定是否进行了初始化
uint8_t enable;
} cmd_decoder_t, *cmd_decoder_t_p;
#ifdef __cplusplus ///<end extern c
}
#endif
#endif//__CMD_DECODER_H__

31
cmd_decoder_makefile Normal file
View File

@ -0,0 +1,31 @@
INC = -I../more_string
LIB =
CFLAGS =
DIR_OBJS = ./obj
DIR_BIN = ./bin
dirs := $(DIR_OBJS) $(DIR_BIN)
bin = more_string_example
src = $(wildcard *.c)
obj = $(patsubst %.c,%.o,$(src)) #patsubst模式字符替换函数 #obj = $(src:.c=.o)
obj := $(addprefix $(DIR_OBJS)/,$(obj))
bin := $(addprefix $(DIR_BIN)/,$(bin))
#$@ 目标(自动变量)
#$^ 依赖
all: $(dirs) $(bin)
$(dirs):
mkdir $@
$(bin):$(obj)
gcc $^ -o $@ $(CFLAGS) $(INC) $(LIB)
$(DIR_OBJS)/%.o:%.c
gcc $^ -o $@ -c $(CFLAGS) $(INC) $(LIB)
clean:
rm -rf $(dirs) $(bin)
.PHONY:all clean

11
readme.md Normal file
View File

@ -0,0 +1,11 @@
# cmd_decoder - a text base command decoder
## depencies
- clone the repository [more_string](https://gitee.com/impressionyang/more_string) in the upper dirctory
## build
```bash
make -f cmd_decoder_makefile
```