Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
blaar
blibs
blc_program
Commits
6d718bab
Commit
6d718bab
authored
Jul 17, 2019
by
Arnaud Blanchard
Browse files
small fixes
parent
99513fd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/blc_command.h
View file @
6d718bab
...
...
@@ -28,8 +28,6 @@ Few functions helping for pseudo realtime applications.
#include
"blc_tools.h"
#define BLC_COMMAND_LOOP_THREAD() for(blc_command_loop_init(-2); blc_command_loop_start();blc_command_loop_end())
/**
period in microseconds
0 for system as fast as possible, -1 for blocking on keyborad, -2 blocking after first iteration.
...
...
@@ -128,10 +126,6 @@ void blc_command_loop_init(long loop_period);
int
blc_command_loop_start
();
void
blc_command_loop_end
();
/**Wait until the blc_loop_stop.
Return the loop_thred pointer (always NULL for now)*/
void
*
blc_loop_wait_stop
();
/** Stop a textual program
* - Send a quitting message with the name of the app on stderr.
* - Send 'q' and flush on stdout if it is a piped output
...
...
src/blc_loop.cpp
View file @
6d718bab
...
...
@@ -14,10 +14,8 @@ struct timeval blc_loop_timer;
static
uint
blc_period
=
0
;
static
uint
blc_duration
=
0
;
static
uint
blc_duration_min
=
UINT_MAX
,
blc_duration_max
=
0
;
static
long
blc_current_duration
;
static
int
intermediate_iteration
;
long
blc_command_loop_period
=-
2
;
//unitialised
uint64_t
blc_loop_iteration_limit
=
UINT64_MAX
;
uint64_t
blc_loop_iteration
=
0
;
...
...
@@ -192,7 +190,6 @@ static void *command_thread_interpret_loop(void *){
while
(
blc_status
!=
BLC_QUIT
){
blc_command_interpret_block
();
if
(
blc_command_loop_period
==-
1
)
BLC_PTHREAD_CHECK
(
pthread_mutex_unlock
(
&
mutex_lock_keyboard
),
NULL
);
//blc_command_interpret();
}
return
NULL
;
}
...
...
@@ -298,9 +295,3 @@ void blc_command_loop_end(){
intermediate_iteration
++
;
blc_loop_iteration
++
;
}
void
*
blc_loop_wait_stop
(){
void
*
result
;
SYSTEM_ERROR_CHECK
(
pthread_join
(
loop_thread
,
&
result
),
-
1
,
NULL
);
return
result
;
}
Arnaud Blanchard
@ablancha
mentioned in commit
a337fbbd
·
Jul 31, 2019
mentioned in commit
a337fbbd
mentioned in commit a337fbbd227236b2bf215730da3e94417ec50569
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment