Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
17
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
d8a9a0c5
Commit
d8a9a0c5
authored
4 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugs-3666' into 'master'
bugs-3666 See merge request
libdap!43
parents
81b95e3d
126fa648
No related branches found
No related tags found
1 merge request
!24
Support 3689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/dap_common.h
+3
-2
3 additions, 2 deletions
include/dap_common.h
src/dap_common.c
+4
-3
4 additions, 3 deletions
src/dap_common.c
with
7 additions
and
5 deletions
include/dap_common.h
+
3
−
2
View file @
d8a9a0c5
...
...
@@ -235,10 +235,11 @@ typedef struct dap_log_history_str_s {
#define DAP_INTERVAL_TIMERS_MAX 15
typedef
void
(
*
dap_timer_callback_t
)(
void
);
typedef
void
(
*
dap_timer_callback_t
)(
void
*
param
);
typedef
struct
dap_timer_interface
{
void
*
timer
;
dap_timer_callback_t
callback
;
void
*
param
;
}
dap_timer_interface_t
;
#ifdef __cplusplus
...
...
@@ -385,7 +386,7 @@ size_t dap_bin2hex(char *a_out, const void *a_in, size_t a_len);
void
dap_digit_from_string
(
const
char
*
num_str
,
void
*
raw
,
size_t
raw_len
);
void
dap_digit_from_string2
(
const
char
*
num_str
,
void
*
raw
,
size_t
raw_len
);
void
*
dap_interval_timer_create
(
unsigned
int
a_msec
,
dap_timer_callback_t
a_callback
);
void
*
dap_interval_timer_create
(
unsigned
int
a_msec
,
dap_timer_callback_t
a_callback
,
void
*
a_param
);
int
dap_interval_timer_delete
(
void
*
a_timer
);
#ifdef __MINGW32__
...
...
This diff is collapsed.
Click to expand it.
src/dap_common.c
+
4
−
3
View file @
d8a9a0c5
...
...
@@ -827,12 +827,12 @@ static int s_timer_find(void *a_timer)
static
void
CALLBACK
s_win_callback
(
PVOID
a_arg
,
BOOLEAN
a_always_true
)
{
UNUSED
(
a_always_true
);
s_timers
[(
int
)
a_arg
].
callback
();
s_timers
[(
int
)
a_arg
].
callback
(
s_timers
[(
int
)
a_arg
].
param
);
}
#else
static
void
s_posix_callback
(
union
sigval
a_arg
)
{
s_timers
[
a_arg
.
sival_int
].
callback
();
s_timers
[
a_arg
.
sival_int
].
callback
(
s_timers
[
a_arg
.
sival_int
].
param
);
}
#endif
...
...
@@ -842,7 +842,7 @@ static void s_posix_callback(union sigval a_arg)
* \param a_callback Function to be called with timer period
* \return pointer to timer object if success, otherwise return NULL
*/
void
*
dap_interval_timer_create
(
unsigned
int
a_msec
,
dap_timer_callback_t
a_callback
)
void
*
dap_interval_timer_create
(
unsigned
int
a_msec
,
dap_timer_callback_t
a_callback
,
void
*
a_param
)
{
if
(
s_timers_count
==
DAP_INTERVAL_TIMERS_MAX
)
{
return
NULL
;
...
...
@@ -876,6 +876,7 @@ void *dap_interval_timer_create(unsigned int a_msec, dap_timer_callback_t a_call
#endif
s_timers
[
s_timers_count
].
timer
=
(
void
*
)
l_timer
;
s_timers
[
s_timers_count
].
callback
=
a_callback
;
s_timers
[
s_timers_count
].
param
=
a_param
;
s_timers_count
++
;
#ifdef _WIN32
LeaveCriticalSection
(
&
s_timers_lock
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment