Added derived constants and error checks

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11277 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
edolomb 2018-01-15 20:15:31 +00:00
parent a455550093
commit 74472ded3a
2 changed files with 23 additions and 0 deletions

View File

@ -156,6 +156,9 @@ OSAL_IRQ_HANDLER(SAMA_TC1_HANDLER) {
void tc_lld_init(void) {
#if SAMA_USE_TC0
#if SAMA_HAL_IS_SECURE
mtxConfigPeriphSecurity(MATRIX1, ID_TC0, SECURE_PER);
#endif /* SAMA_HAL_IS_SECURE */
/* Driver initialization.*/
tcObjectInit(&TCD0);
TCD0.channels = TC_CHANNELS;
@ -164,6 +167,9 @@ void tc_lld_init(void) {
#endif
#if SAMA_USE_TC1
#if SAMA_HAL_IS_SECURE
mtxConfigPeriphSecurity(MATRIX1, ID_TC1, SECURE_PER);
#endif /* SAMA_HAL_IS_SECURE */
/* Driver initialization.*/
tcObjectInit(&TCD1);
TCD1.channels = TC_CHANNELS;

View File

@ -133,6 +133,23 @@ typedef void (*tccallback_t)(TCDriver *tcp);
#error "TC driver activated but no TC peripheral assigned"
#endif
/* Checks on allocation of TCx units.*/
#if SAMA_USE_TC0
#if defined(SAMA_TC0_IS_USED)
#error "TC0 is already used"
#else
#define SAMA_TC0_IS_USED
#endif
#endif
/* Checks on allocation of TCx units.*/
#if SAMA_USE_TC1
#if defined(SAMA_TC1_IS_USED)
#error "TC1 is already used"
#else
#define SAMA_TC1_IS_USED
#endif
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/