Skip to content

EventQueue overflow #7732

@simonnilsson

Description

@simonnilsson

Description

Target
Multiple, tested with stm32l072 target

Tools
Keil uVision

Mbed OS Version
be215a3

As requested by @jeromecoutant I am submitting a new issue for a bug briefly discussed here: #6840.

In equeue_sema_wait in equeue_mbed.cpp if RTOS not present the ms argument is passed as a signed integer and then multiplied by 1000. This causes an overflow in some cases!

Changing this:

timeout.attach_us(callback(equeue_sema_timeout, s), ms*1000);

to this

timeout.attach_us(callback(equeue_sema_timeout, s), (us_timestamp_t)ms*1000);

Solves the problem for me, but it is still handled as a integer outside this function so might be other issues with this.

[ ] Question
[ ] Enhancement
[x] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions