File tree 1 file changed +15
-7
lines changed
Filter options
1 file changed +15
-7
lines changed
Original file line number Diff line number Diff line change 1
- classdef webserver < handle % #codegen
1
+ classdef stl < handle % #codegen
2
2
3
3
methods (Static )
4
4
5
- // command line arguments
5
+ % command line arguments
6
6
function ac = argc()
7
7
coder .cinclude(' stl.h' );
8
8
31
31
end
32
32
end
33
33
34
- // thread
34
+ % thread
35
35
function tid = launch(name , arg )
36
36
coder .cinclude(' stl.h' );
37
37
@@ -66,12 +66,12 @@ function sleep(t)
66
66
id = coder .ceval(' stl_thread_self' ); % evaluate the C function
67
67
end
68
68
69
- // mutex
69
+ % mutex
70
70
function mutex(name )
71
71
coder .ceval(' stl_launch' , [name 0 ]); % evaluate the C function
72
72
end
73
73
74
- // semaphore
74
+ % semaphore
75
75
function sid = semaphore(name )
76
76
coder .cinclude(' stl.h' );
77
77
@@ -94,8 +94,16 @@ function semwait(id, wait)
94
94
coder .ceval(' stl_sem_wait' , id , wait ); % evaluate the C function
95
95
end
96
96
97
- // logging
98
- function stllog(varargin )
97
+ % timer
98
+ function tmid = timer(name , interval , semid )
99
+ coder .cinclude(' stl.h' );
100
+
101
+ tmid = int32(0 );
102
+ tmid = coder .ceval(' stl_timer_create' , cstring(name ), interval , semid ); % evaluate the C function
103
+ end
104
+
105
+ % logging
106
+ function log(varargin )
99
107
% stl.log Send formatted string to log
100
108
%
101
109
% stl.log(fmt, args...) has printf() like semantics and sends the formatted
You can’t perform that action at this time.
0 commit comments