Fix assignment of currcore when PORT_CORES_NUMBER not defined

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14195 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
cinsights 2021-04-16 01:33:11 +00:00
parent 6d6e4e415c
commit 6be40fd227
1 changed files with 12 additions and 8 deletions

View File

@ -60,14 +60,18 @@
* @brief Access to current core's instance structure.
*/
#if defined(PORT_INSTANCE_ACCESS)
#define currcore PORT_INSTANCE_ACCESS
#else
#if (PORT_CORES_NUMBER == 0) || defined(__DOXYGEN__)
#define currcore (&ch0)
#else
#define currcore ch_system.instances[port_get_core_id()]
#endif
#endif
#define currcore PORT_INSTANCE_ACCESS
#else /* !defined(PORT_INSTANCE_ACCESS) */
#if defined(PORT_CORES_NUMBER)
#if (PORT_CORES_NUMBER > 1) || defined(__DOXYGEN__)
#define currcore ch_system.instances[port_get_core_id()]
#else
#define currcore (&ch0)
#endif
#else
#define currcore (&ch0)
#endif /* defined(PORT_CORES_NUMBER) */
#endif /* defined(PORT_INSTANCE_ACCESS) */
/*===========================================================================*/
/* Module macros. */