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
Øyvind Kolås
firmware
Commits
613afe3b
Commit
613afe3b
authored
Oct 14, 2020
by
Rahix
Browse files
Merge 'streams: Only print a single warning once a queue is full'
Closes #208 See merge request
card10/firmware!408
parents
b84cd7e9
8ee0c644
Changes
4
Hide whitespace changes
Inline
Side-by-side
epicardium/modules/bhi.c
View file @
613afe3b
...
...
@@ -315,7 +315,16 @@ bhi160_handle_packet(bhy_data_type_t data_type, bhy_data_generic_t *sensor_data)
bhi160_streams
[
sensor_type
].
queue
,
&
data_vector
,
0
)
!=
pdTRUE
)
{
LOG_WARN
(
"bhi160"
,
"queue full for %d"
,
sensor_type
);
if
(
!
bhi160_streams
[
sensor_type
].
was_full
)
{
LOG_WARN
(
"bhi160"
,
"queue full for %d"
,
sensor_type
);
}
bhi160_streams
[
sensor_type
].
was_full
=
true
;
}
else
{
bhi160_streams
[
sensor_type
].
was_full
=
false
;
}
if
(
wakeup
)
{
...
...
epicardium/modules/max30001.c
View file @
613afe3b
...
...
@@ -137,7 +137,12 @@ static void max30001_handle_samples(int16_t *sensor_data, int16_t n)
/* Discard overflow. See discussion in !316. */
if
(
xQueueSend
(
max30001_stream
.
queue
,
&
data
,
0
)
!=
pdTRUE
)
{
LOG_WARN
(
"max30001"
,
"queue full"
);
if
(
!
max30001_stream
.
was_full
)
{
LOG_WARN
(
"max30001"
,
"queue full"
);
}
max30001_stream
.
was_full
=
true
;
}
else
{
max30001_stream
.
was_full
=
false
;
}
}
interrupt_trigger
(
EPIC_INT_MAX30001_ECG
);
...
...
epicardium/modules/max86150.c
View file @
613afe3b
...
...
@@ -136,8 +136,13 @@ static int max86150_handle_sample(struct max86150_sensor_data *data)
/* Discard overflow. See discussion in !316. */
if
(
xQueueSend
(
max86150_stream
.
queue
,
data
,
0
)
!=
pdTRUE
)
{
LOG_WARN
(
"max86150"
,
"queue full"
);
if
(
!
max86150_stream
.
was_full
)
{
LOG_WARN
(
"max86150"
,
"queue full"
);
}
max86150_stream
.
was_full
=
true
;
return
-
EIO
;
}
else
{
max86150_stream
.
was_full
=
false
;
}
interrupt_trigger
(
EPIC_INT_MAX86150
);
...
...
epicardium/modules/stream.h
View file @
613afe3b
...
...
@@ -67,6 +67,12 @@ struct stream_info {
* The function registered here should never block for a longer time.
*/
int
(
*
poll_stream
)();
/**
* Set to true if the last write to ``queue`` failed because
* the queue was full.
*/
bool
was_full
;
};
/**
...
...
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