This commit is contained in:
parent
84ffca6d33
commit
08f5b23a61
|
@ -365,6 +365,11 @@ extern "C"
|
||||||
*/
|
*/
|
||||||
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* micro-optimization: use same (lower-level) api for lock/unlock regardless on context
|
||||||
|
* this saves us one branching
|
||||||
|
*/
|
||||||
|
#define USE_PORT_LOCK FALSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Debug option, parameters checks.
|
* @brief Debug option, parameters checks.
|
||||||
|
|
|
@ -285,6 +285,9 @@ bool lockAnyContext(void) {
|
||||||
int alreadyLocked = isLocked();
|
int alreadyLocked = isLocked();
|
||||||
if (alreadyLocked)
|
if (alreadyLocked)
|
||||||
return true;
|
return true;
|
||||||
|
#if USE_PORT_LOCK
|
||||||
|
port_lock();
|
||||||
|
#else
|
||||||
if (isIsrContext()) {
|
if (isIsrContext()) {
|
||||||
chSysLockFromISR()
|
chSysLockFromISR()
|
||||||
;
|
;
|
||||||
|
@ -292,6 +295,7 @@ bool lockAnyContext(void) {
|
||||||
chSysLock()
|
chSysLock()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,8 @@
|
||||||
*/
|
*/
|
||||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||||
|
|
||||||
|
#define USE_PORT_LOCK TRUE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Debug option, parameters checks.
|
* @brief Debug option, parameters checks.
|
||||||
* @details If enabled then the checks on the API functions input
|
* @details If enabled then the checks on the API functions input
|
||||||
|
|
Loading…
Reference in New Issue