mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Adding RP2350 SDK and target framework (#13988)
* Adding RP2350 SDK and target framework * Spacing * Removing board definitions
This commit is contained in:
parent
462cb05930
commit
2dd6f95aad
576 changed files with 435012 additions and 0 deletions
25
lib/main/pico-sdk/common/pico_sync/critical_section.c
Normal file
25
lib/main/pico-sdk/common/pico_sync/critical_section.c
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "pico/critical_section.h"
|
||||
|
||||
#if PICO_32BIT
|
||||
static_assert(sizeof(critical_section_t) == 8, "");
|
||||
#endif
|
||||
|
||||
void critical_section_init(critical_section_t *crit_sec) {
|
||||
critical_section_init_with_lock_num(crit_sec, (uint)spin_lock_claim_unused(true));
|
||||
}
|
||||
|
||||
void critical_section_init_with_lock_num(critical_section_t *crit_sec, uint lock_num) {
|
||||
crit_sec->spin_lock = spin_lock_instance(lock_num);
|
||||
__mem_fence_release();
|
||||
}
|
||||
|
||||
void critical_section_deinit(critical_section_t *crit_sec) {
|
||||
spin_lock_unclaim(spin_lock_get_num(crit_sec->spin_lock));
|
||||
crit_sec->spin_lock = NULL;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue