File tree Expand file tree Collapse file tree 6 files changed +394
-5
lines changed Expand file tree Collapse file tree 6 files changed +394
-5
lines changed Original file line number Diff line number Diff line change
1
+ [submodule "unit_test/unity "]
2
+ path = unit_test/unity
3
+ url = https://github.com/ThrowTheSwitch/Unity
Original file line number Diff line number Diff line change @@ -559,7 +559,7 @@ app_timer_error_e app_timer_init(app_timer_hw_model_t *model)
559
559
560
560
if (NULL == model )
561
561
{
562
- return APP_TIMER_INVALID_PARAM ;
562
+ return APP_TIMER_NULL_PARAM ;
563
563
}
564
564
565
565
if ((0u == model -> max_count ) ||
Original file line number Diff line number Diff line change @@ -148,10 +148,11 @@ typedef void (*app_timer_handler_t)(void *);
148
148
*/
149
149
typedef enum
150
150
{
151
- APP_TIMER_OK ,
152
- APP_TIMER_INVALID_PARAM ,
153
- APP_TIMER_INVALID_STATE ,
154
- APP_TIMER_ERROR
151
+ APP_TIMER_OK , ///< Operation successful
152
+ APP_TIMER_NULL_PARAM , ///< NULL pointer passed as parameter
153
+ APP_TIMER_INVALID_PARAM , ///< Invalid data passed as parameter
154
+ APP_TIMER_INVALID_STATE , ///< Operation not allowed in current state (has app_timer_init been called?)
155
+ APP_TIMER_ERROR ///< Unspecified internal error
155
156
} app_timer_error_e ;
156
157
157
158
Original file line number Diff line number Diff line change
1
+ OUTPUT_DIR := build
2
+ OBJ_DIR := $(OUTPUT_DIR ) /obj
3
+
4
+ ifeq ($(OS ) ,Windows_NT)
5
+ # Windows-specific vars; if you did a custom install of MinGW, or if you are using some
6
+ # other compiler, then you might need to change some of these values
7
+ # BIN_DIR := C:/MinGW/bin
8
+ BIN_DIR := C:/msys64/mingw64/bin
9
+ GCC := $(BIN_DIR ) /gcc
10
+ LD := $(BIN_DIR ) /ld
11
+ MKDIR := mkdir -p
12
+ RMDIR := rm -rf
13
+ else
14
+ ifeq ($(shell uname -s),Linux)
15
+ # Linux-specific vars
16
+ GCC := gcc
17
+ LD := ld
18
+ MKDIR := mkdir -p
19
+ RMDIR := rm -rf
20
+ endif
21
+ endif
22
+
23
+ OUTPUT_DIR := build
24
+ TEST_PROG := $(OUTPUT_DIR ) /test_app_timer
25
+
26
+ SRC_FILES := ../app_timer.c test_app_timer.c unity/src/unity.c
27
+ INCLUDES := -Iunity/src -I../
28
+
29
+ .PHONY : clean test
30
+
31
+ default : test
32
+
33
+ all : clean test
34
+
35
+ test : $(TEST_PROG )
36
+
37
+ $(TEST_PROG ) : $(OUTPUT_DIR )
38
+ $(GCC ) $(SRC_FILES ) $(INCLUDES ) -o $(TEST_PROG )
39
+ ./$(TEST_PROG )
40
+
41
+ $(OUTPUT_DIR ) :
42
+ $(MKDIR ) $(OUTPUT_DIR )
43
+
44
+ clean :
45
+ @$(RMDIR ) $(OUTPUT_DIR )
46
+ @echo " Outputs removed"
You can’t perform that action at this time.
0 commit comments