File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 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
22
33 methods (Static )
44
5- // command line arguments
5+ % command line arguments
66 function ac = argc()
77 coder .cinclude(' stl.h' );
88
3131 end
3232 end
3333
34- // thread
34+ % thread
3535 function tid = launch(name , arg )
3636 coder .cinclude(' stl.h' );
3737
@@ -66,12 +66,12 @@ function sleep(t)
6666 id = coder .ceval(' stl_thread_self' ); % evaluate the C function
6767 end
6868
69- // mutex
69+ % mutex
7070 function mutex(name )
7171 coder .ceval(' stl_launch' , [name 0 ]); % evaluate the C function
7272 end
7373
74- // semaphore
74+ % semaphore
7575 function sid = semaphore(name )
7676 coder .cinclude(' stl.h' );
7777
@@ -94,8 +94,16 @@ function semwait(id, wait)
9494 coder .ceval(' stl_sem_wait' , id , wait ); % evaluate the C function
9595 end
9696
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 )
99107 % stl.log Send formatted string to log
100108 %
101109 % stl.log(fmt, args...) has printf() like semantics and sends the formatted
You can’t perform that action at this time.
0 commit comments