usb_lld.c uses the CORTEX_PRIO_MASK() macro which is part of chcore_v7m.h. Is it better to use an osal function/macro there?
By the way, in the os-less osal the function __set_BASEPRI is used without the CORTEX_PRIO_MASK or the NVIC_PRIORITY_MASK. So it will not has any effect to the basepri when
Code: Select all
__set_BASEPRI(OSAL_IRQ_MAXIMUM_PRIORITY);
is called in the osalSysLock(void) function due to the number of implemented priority bits.
Maybe it is better to change this to something like:
Code: Select all
static inline void osalSysLock(void) {
#if CORTEX_MODEL == 0
__disable_irq();
#else
__set_BASEPRI(NVIC_PRIORITY_MASK(OSAL_IRQ_MAXIMUM_PRIORITY));
#endif
}
But than we have to include the nvic.h in the osal.h and not in the hal_lld.h (line 1146).
Thanks