Bunch of small fixes (#154)
* use valid_params_if macro for lock assertion * fixup param checking in pwm.h * Fix range of fractional divider parameter check in pwm.h Co-authored-by: Luke Wren <wren6991@gmail.com>
This commit is contained in:
committed by
graham sanderson
parent
0732d0c2a3
commit
b53b0bac70
@ -10,6 +10,11 @@
|
||||
#include "pico.h"
|
||||
#include "hardware/sync.h"
|
||||
|
||||
// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_LOCK_CORE, Enable/disable assertions in the lock core, type=bool, default=1, group=pico_sync
|
||||
#ifndef PARAM_ASSERTIONS_ENABLED_LOCK_CORE
|
||||
#define PARAM_ASSERTIONS_ENABLED_LOCK_CORE 1
|
||||
#endif
|
||||
|
||||
/** \file lock_core.h
|
||||
* \ingroup pico_sync
|
||||
*
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "pico/lock_core.h"
|
||||
|
||||
void lock_init(lock_core_t *core, uint lock_num) {
|
||||
assert(lock_num < NUM_SPIN_LOCKS);
|
||||
valid_params_if(LOCK_CORE, lock_num < NUM_SPIN_LOCKS);
|
||||
core->spin_lock = spin_lock_instance(lock_num);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user