step1: defined a global variable in key.c: uint8_t PHOTO_COUNT = 0;
step2: extern it in key.h:extern uint8_t PHOTO_COUNT;
step3:add #include "key.h" in key.c and main.c
step4: add key.c in makefile.
Code: Select all
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(STARTUPSRC) \
$(KERNSRC) \
$(PORTSRC) \
$(OSALSRC) \
$(HALSRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
$(TESTSRC) \
main.c \
key.c \
step5: use the variable in main.c: PHOTO_COUNT=1;
after building,there are 2 eerors:
key.h:19:1: error: unknown type name 'uint8_t'
key.c:31:9: error: conflicting types for 'PHOTO_COUNT'
expected your answers,thank you .