Small API additions and minor fixes (#406)
* Add missing DREQ_s * store actual clock frequency in clock_configure (fixes #368) * use dma DREQ values defined in dreqs/dma.h * Fix hw_is_claimed, and add xxx_is_claimed APIs * Add some PIO irq helper methods * Add DMA channel IRQ status getter and clear methods * Implement the correct PIO IRQ status/clear methods (good to have methods here as the h/w interrupt registers are super confusing) * fix pico_multicore dependencies * add missing wrapper func __aeabi_f2d * Further DMA/PIO IRQ API cleanup (and review fixes) * add PICO_INT64_OPS_IN_RAM flag
This commit is contained in:
@ -384,6 +384,16 @@ void spin_lock_unclaim(uint lock_num);
|
||||
*/
|
||||
int spin_lock_claim_unused(bool required);
|
||||
|
||||
/*! \brief Determine if a spin lock is claimed
|
||||
* \ingroup hardware_sync
|
||||
*
|
||||
* \param lock_num the spin lock number
|
||||
* \return true if claimed, false otherwise
|
||||
* \see spin_lock_claim
|
||||
* \see spin_lock_claim_mask
|
||||
*/
|
||||
bool spin_lock_is_claimed(uint lock_num);
|
||||
|
||||
#define remove_volatile_cast(t, x) ({__mem_fence_acquire(); (t)(x); })
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -57,3 +57,8 @@ int spin_lock_claim_unused(bool required) {
|
||||
return hw_claim_unused_from_range((uint8_t*)&claimed, required, PICO_SPINLOCK_ID_CLAIM_FREE_FIRST, PICO_SPINLOCK_ID_CLAIM_FREE_LAST, "No spinlocks are available");
|
||||
}
|
||||
|
||||
bool spin_lock_is_claimed(uint lock_num) {
|
||||
check_lock_num(lock_num);
|
||||
return hw_is_claimed((uint8_t *) &claimed, lock_num);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user