Skip to content

Does SST_Task_lock() need to handle basepri_ == 0? #7

Open

Description

@xbin-xu

The BASEPRI reset value is 0x00000000, which means masking is disabled
(BASEPRI has no effect).
See Exception mask registers.

when basepri_ is 0, the condition basepri_ > nvic_prio is always false, so
the lock not work as expected.

So does SST_Task_lock() need to be modified like this?

- if (basepri_ > nvic_prio) { /* current priority lower than the ceiling? */
+ if ((basepri_ == 0) || (basepri_ > nvic_prio)) { /* current priority lower than the ceiling? */

Activity

  1. changed the title [-]SST_Task_lock() needs to handle basepri_ == 0?[/-] [+]Does SST_Task_lock() need to handle basepri_ == 0?[/+] on Oct 13, 2026
  2. mattheweshleman commented on Oct 18, 2026

    @mattheweshleman
    Contributor

    The answer appears to be yes. I would suggest opening a pull-request with the appropriate changes to the C and C++ versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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