mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-08 06:35:12 +00:00
uorb: use another writing method to avoid compiler bug
int func(int b)
{
int a;
while (1) {
...;
if (b != 0)
a = 1000 / b;
...;
}
}
if b == 0, then system crash in Xtensa arch, clang compiler
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
8558e63772
commit
37f1e453b1
1 changed files with 4 additions and 2 deletions
|
|
@ -499,6 +499,7 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects,
|
|||
{
|
||||
FAR struct pollfd *fds;
|
||||
FAR int *recv_msgs;
|
||||
int interval = topic_rate ? 1000000 / topic_rate : 0;
|
||||
int nb_recv_msgs = 0;
|
||||
int i = 0;
|
||||
|
||||
|
|
@ -541,9 +542,10 @@ static void listener_monitor(FAR struct list_node *objlist, int nb_objects,
|
|||
listener_print(tmp->object.meta, fd);
|
||||
orb_unsubscribe(fd);
|
||||
}
|
||||
else if (topic_rate != 0)
|
||||
else if (interval != 0)
|
||||
{
|
||||
orb_set_frequency(fd, topic_rate);
|
||||
orb_set_interval(fd, interval);
|
||||
|
||||
if (topic_latency != 0)
|
||||
{
|
||||
orb_set_batch_interval(fd, topic_latency);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue