YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
lock_base_rp2350.cpp
1// ---------------------------------------------
2// This file is part of
3// _ _ __ _ _ __ __
4// ( \/ ) /__\ ( )_( ) /__\ ( )
5// \ / /(__)\ ) _ ( /(__)\ )(__
6// (__)(__)(__)(_) (_)(__)(__)(____)
7//
8// Yet Another HW Abstraction Library
9// Copyright (C) Andreas Terstegge
10// BSD Licensed (see file LICENSE)
11//
12// ---------------------------------------------
13//
14// Implementation of lock base interface for RP2350.
15//
16#include "lock_base_rp2350.h"
17#include <cassert>
18
19uint32_t lock_base_rp2350::_index = 0;
20
21lock_base_rp2350::lock_base_rp2350() {
22 assert(_index < 32);
23 _lock = SIO.SPINLOCK + _index;
24 _mask = 1 << _index;
25 _index++;
26}
27
28lock_base_rp2350::~lock_base_rp2350() {
29 unlock();
30 _index--;
31}