@@ -13,28 +13,37 @@ fn main() {
13
13
. file ( "c-lib/add.c" )
14
14
. compile ( "libadd.a" ) ;
15
15
16
-
17
-
18
16
// Build FreeRTOS for Windows
19
17
let freertos_src_path = PathBuf :: from ( "FreeRTOS/FreeRTOS/Source/" ) ;
20
18
let freertos_plus_src_path = PathBuf :: from ( "FreeRTOS/FreeRTOS-Plus/Source/" ) ;
21
19
let freertos_demo_path = PathBuf :: from ( "FreeRTOS/FreeRTOS/Demo" ) ;
20
+ //let demo = "WIN32-MingW";
21
+ let port = "MSVC-MingW" ;
22
+
23
+ let demo = "WIN32-MSVC" ;
24
+ //let port = "MSVC-MingW";
22
25
23
26
cc:: Build :: new ( )
24
27
// TODO: This is the windows specific part that needs to be env specific
25
28
. include ( freertos_src_path. join ( "include" ) )
26
- //.include(freertos_demo_path.join("WIN32-MSVC") )
27
- . include ( freertos_demo_path. join ( "WIN32-MSVC/ Trace_Recorder_Configuration") )
29
+ //.include(freertos_demo_path.join(demo )
30
+ . include ( freertos_demo_path. join ( demo ) . join ( " Trace_Recorder_Configuration") )
28
31
. include ( freertos_plus_src_path. join ( "FreeRTOS-Plus-Trace/Include" ) )
29
- . include ( freertos_src_path. join ( "portable/MSVC-MingW" ) )
30
- . file ( freertos_demo_path. join ( "WIN32-MSVC/Run-time-stats-utils.c" ) )
32
+ . include ( freertos_src_path. join ( "portable" ) . join ( port) )
33
+ // TODO: Make runtime stats not needed or move to /src/ports/win/...
34
+ . file ( freertos_demo_path. join ( demo) . join ( "Run-time-stats-utils.c" ) )
31
35
32
36
// Files related to port
33
- . include ( "src/ports/win" )
34
- . file ( "src/ports/win/hooks.c" )
37
+ . include ( "src/freertos/ports/win" )
38
+ . file ( "src/freertos/ports/win/hooks.c" )
39
+ . file ( "src/freertos/ports/win/heap.c" )
40
+ . file ( "src/freertos/freertos_shim.c" )
35
41
42
+ // FreeRTOS Plus Trace is needed for windows Demo
36
43
. file ( freertos_plus_src_path. join ( "FreeRTOS-Plus-Trace/trcKernelPort.c" ) )
37
44
. file ( freertos_plus_src_path. join ( "FreeRTOS-Plus-Trace/trcSnapshotRecorder.c" ) )
45
+
46
+ // FreeRTOS
38
47
. file ( freertos_src_path. join ( "croutine.c" ) )
39
48
. file ( freertos_src_path. join ( "event_groups.c" ) )
40
49
. file ( freertos_src_path. join ( "portable/MemMang/heap_5.c" ) )
@@ -43,9 +52,7 @@ fn main() {
43
52
. file ( freertos_src_path. join ( "list.c" ) )
44
53
. file ( freertos_src_path. join ( "queue.c" ) )
45
54
. file ( freertos_src_path. join ( "tasks.c" ) )
46
- . file ( freertos_src_path. join ( "portable/MSVC-MingW/port.c" ) )
47
-
48
- //.file("src/freertos_shim.c")
55
+ . file ( freertos_src_path. join ( "portable" ) . join ( port) . join ( "port.c" ) )
49
56
50
57
. compile ( "libfreertos.a" ) ;
51
58
@@ -67,10 +74,12 @@ fn main() {
67
74
// The input header we would like to generate
68
75
// bindings for.
69
76
. header ( "src/bindings.h" )
77
+ . header ( "src/freertos/freertos_shim.h" )
70
78
//portmacro.h
71
79
//.clang_arg(format!("-I{}", freertos_src_path.join("portable/MSVC-MingW").to_str().unwrap()))
72
- . clang_arg ( format ! ( "-I{}" , freertos_demo_path. join( "WIN32-MSVC" ) . to_str( ) . unwrap( ) ) )
73
- . clang_arg ( format ! ( "-I{}" , freertos_demo_path. join( "WIN32-MSVC/Trace_Recorder_Configuration" ) . to_str( ) . unwrap( ) ) )
80
+ . clang_arg ( format ! ( "-I{}" , freertos_src_path. join( "include" ) . to_str( ) . unwrap( ) ) )
81
+ . clang_arg ( format ! ( "-I{}" , freertos_demo_path. join( demo) . to_str( ) . unwrap( ) ) )
82
+ . clang_arg ( format ! ( "-I{}" , freertos_demo_path. join( demo) . join( "Trace_Recorder_Configuration" ) . to_str( ) . unwrap( ) ) )
74
83
. clang_arg ( format ! ( "-I{}" , freertos_plus_src_path. join( "FreeRTOS-Plus-Trace/Include" ) . to_str( ) . unwrap( ) ) )
75
84
// Make the generated code #![no_std] compatible
76
85
. use_core ( )
0 commit comments