Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Sven Gestegård Robertz
LabComm
Commits
d7b40aa9
Commit
d7b40aa9
authored
13 years ago
by
Sven Robertz
Browse files
Options
Downloads
Patches
Plain Diff
cleaned up debug output
parent
548160e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/c/ThrottleDrv/throttle_drv.c
+16
-4
16 additions, 4 deletions
lib/c/ThrottleDrv/throttle_drv.c
lib/c/labcomm.c
+0
-1
0 additions, 1 deletion
lib/c/labcomm.c
lib/c/labcomm_thr_reader_writer.c
+0
-2
0 additions, 2 deletions
lib/c/labcomm_thr_reader_writer.c
with
16 additions
and
7 deletions
lib/c/ThrottleDrv/throttle_drv.c
+
16
−
4
View file @
d7b40aa9
...
...
@@ -133,7 +133,9 @@ struct thr_chn_t* thr_open_chn(const unsigned char* dst_adr, unsigned char chn_i
tmp_chn
->
freq
=
freq
;
tmp_chn
->
funct
=
funct
;
}
#ifdef DEBUG
printf
(
"thr_open_chn: callback = %x
\n
"
,
tmp_chn
->
funct
);
#endif
}
...
...
@@ -277,7 +279,9 @@ int thr_receive(struct thr_chn_t* thr_chn, unsigned char* data, void* param)
}
else
{
printf
(
"Message Index %d on %d. Actual Index %d
\n
"
,
THR_MSG_FRAG_NUM
(
thr_msg
),
THR_MSG_FRAG_TOT_NUM
(
thr_msg
),
frag_index
);
#ifdef DEBUG
printf
(
"thr_receive: Message Index %d on %d. Actual Index %d
\n
"
,
THR_MSG_FRAG_NUM
(
thr_msg
),
THR_MSG_FRAG_TOT_NUM
(
thr_msg
),
frag_index
);
#endif
if
(
frag_index
==
THR_MSG_FRAG_NUM
(
thr_msg
))
/* The fragment is the one expected ? */
{
/* Rebuild the original data linking the payloads of each fragment */
...
...
@@ -292,7 +296,7 @@ int thr_receive(struct thr_chn_t* thr_chn, unsigned char* data, void* param)
}
else
{
printf
(
"Fragment mismatch: Fragment discarded.
\n
"
);
printf
(
"
thr_receive:
Fragment mismatch: Fragment discarded.
\n
"
);
frag_index
=
1
;
p_data
=
data
;
}
...
...
@@ -308,10 +312,14 @@ int thr_receive(struct thr_chn_t* thr_chn, unsigned char* data, void* param)
}
else
{
printf
(
"Number of byte receive %d
\n
"
,
ret
);
#ifdef DEBUG
printf
(
"thr_receive: Number of byte receive %d
\n
"
,
ret
);
#endif
thr_chn
->
msg_length
=
ret
;
memcpy
(
thr_chn
->
p_msg
,
data
,
ret
);
/* copy the msg into the thr structure */
printf
(
"calling %x
\n
"
,
thr_chn
->
funct
);
#ifdef DEBUG
printf
(
"thr_receive: calling %x
\n
"
,
thr_chn
->
funct
);
#endif
(
thr_chn
->
funct
)(
param
);
free
(
thr_chn
->
p_msg
);
thr_chn
->
p_msg
=
NULL
;
...
...
@@ -374,9 +382,13 @@ int thr_read(struct thr_chn_t* thr_chn, unsigned char* data, int length)
if
(
length
>
thr_chn
->
msg_length
)
{
length
=
thr_chn
->
msg_length
;
#ifdef DEBUG
printf
(
"thr_read: truncating length to %d
\n
"
,
length
);
#endif
}
#ifdef DEBUG
printf
(
"thr_read: calling memcpy(%x, %x, %d
\n
"
,
data
,
thr_chn
->
p_msg
,
length
);
#endif
memcpy
(
data
,
thr_chn
->
p_msg
,
length
);
/* copy the msg into the thr structure */
ret
=
length
;
thr_chn
->
msg_length
=
0
;
...
...
This diff is collapsed.
Click to expand it.
lib/c/labcomm.c
+
0
−
1
View file @
d7b40aa9
...
...
@@ -418,7 +418,6 @@ int labcomm_decoder_decode_one(labcomm_decoder_t *d)
int
result
=
-
1
;
if
(
d
&&
d
->
do_decode_one
)
{
printf
(
"labcomm decode 1
\n
"
);
result
=
d
->
do_decode_one
(
d
);
}
else
...
...
This diff is collapsed.
Click to expand it.
lib/c/labcomm_thr_reader_writer.c
+
0
−
2
View file @
d7b40aa9
...
...
@@ -33,7 +33,6 @@ int labcomm_thr_reader(labcomm_reader_t *r, labcomm_reader_action_t action)
case
labcomm_reader_start
:
case
labcomm_reader_continue
:
{
printf
(
"labcomm_reader_start or continue...
\n
"
);
if
(
r
->
pos
<
r
->
count
)
{
result
=
r
->
count
-
r
->
pos
;
...
...
@@ -42,7 +41,6 @@ int labcomm_thr_reader(labcomm_reader_t *r, labcomm_reader_action_t action)
{
int
err
;
r
->
pos
=
0
;
printf
(
"labcomm_thr_reader_writer. calling thr_read: %x, %x, %d
\n
"
,
ctx
,
r
->
data
,
r
->
data_size
);
err
=
thr_read
(
ctx
,
r
->
data
,
r
->
data_size
);
if
(
err
<=
0
)
{
...
...
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