Skip to content

Better RTOS integration for mbed-drivers #2310

Closed
@anpilog

Description

@anpilog

Hi,

As @0xc0170 suggested I created this issue as place to discuss RTOS integration to drivers (SPI, I2C, etc).

lock()/unlock() methods should address common user needs in better way.

As one of the option it could be:

class SPI {
public:
    virtual bool lock(uint32_t millisec=osWaitForever) {
        return _mutex->lock(millisec) == osOK;
    }
}

IMHO those lock/unlock wrappers around mutex should be used only by user.
Current approach when each driver method user lock()/unlock() covers only integrity of register access.
But in case of SPI, for example, more important to cover a transaction.
And so far user has to use separate mutex for this.

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