-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
SHELL = /bin/bash | ||
ifeq ($(PARAM_FILE), ) | ||
PARAM_FILE:=../../Makefile.param | ||
include $(PARAM_FILE) | ||
endif | ||
include ../sample.mk | ||
|
||
SDIR = $(PWD) | ||
SRCS = $(wildcard $(SDIR)/*.c) | ||
INCS = -I$(MW_INC) -I$(ISP_INC) -I../common/ -I$(KERNEL_INC) -I./inc | ||
OBJS = $(SRCS:.c=.o) | ||
DEPS = $(SRCS:.c=.d) | ||
|
||
TARGET = chipid | ||
|
||
PKG_CONFIG_PATH = $(MW_PATH)/pkgconfig | ||
REQUIRES = cvi_common | ||
|
||
MW_LIBS = $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --define-variable=mw_dir=$(MW_PATH) $(REQUIRES)) | ||
|
||
LIBS = $(MW_LIBS) | ||
|
||
EXTRA_CFLAGS = $(INCS) $(DEFS) | ||
EXTRA_LDFLAGS = $(LIBS) | ||
|
||
.PHONY : clean all | ||
all: $(TARGET) | ||
|
||
$(COMMON_DIR)/%.o: $(COMMON_DIR)/%.c | ||
@$(CC) $(DEPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< | ||
@echo [$(notdir $(CC))] $(notdir $@) | ||
|
||
$(SDIR)/%.o: $(SDIR)/%.c | ||
@$(CC) $(DEPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< | ||
@echo [$(notdir $(CC))] $(notdir $@) | ||
|
||
$(TARGET): $(COMM_OBJ) $(OBJS) $(ISP_OBJ) $(MW_LIB)/libsys.a | ||
@$(CXX) -o $@ -Wl,--start-group $(OBJS) $(COMM_OBJS) -lsys $(MW_LIB)/libsys.a -Wl,--end-group $(ELFFLAGS) $(EXTRA_LDFLAGS) | ||
@echo -e $(BLUE)[LINK]$(END)[$(notdir $(CXX))] $(notdir $@) | ||
|
||
clean: | ||
@rm -f $(OBJS) $(DEPS) $(COMM_OBJ) $(COMM_DEPS) $(TARGET) | ||
|
||
-include $(DEPS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <stdint.h> | ||
|
||
#include "cvi_buffer.h" | ||
|
||
#include "cvi_sys.h" | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
CVI_U32 id = 0; | ||
CVI_S32 ret = CVI_SUCCESS; | ||
|
||
UNUSED(argc); | ||
UNUSED(argv); | ||
|
||
ret = CVI_SYS_GetChipId(&id); | ||
|
||
switch (id) { | ||
case E_CHIPID_CV1800B: | ||
printf("cv1800b\n"); | ||
break; | ||
case E_CHIPID_CV1812C: | ||
printf("cv1812c\n"); | ||
break; | ||
case E_CHIPID_CV1813H: | ||
printf("cv1813h\n"); | ||
break; | ||
default: | ||
printf("unsupported chip id\n"); | ||
break; | ||
} | ||
|
||
return ret; | ||
} | ||
|