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:
parent
a455550093
commit
74472ded3a
|
@ -156,6 +156,9 @@ OSAL_IRQ_HANDLER(SAMA_TC1_HANDLER) {
|
||||||
void tc_lld_init(void) {
|
void tc_lld_init(void) {
|
||||||
|
|
||||||
#if SAMA_USE_TC0
|
#if SAMA_USE_TC0
|
||||||
|
#if SAMA_HAL_IS_SECURE
|
||||||
|
mtxConfigPeriphSecurity(MATRIX1, ID_TC0, SECURE_PER);
|
||||||
|
#endif /* SAMA_HAL_IS_SECURE */
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
tcObjectInit(&TCD0);
|
tcObjectInit(&TCD0);
|
||||||
TCD0.channels = TC_CHANNELS;
|
TCD0.channels = TC_CHANNELS;
|
||||||
|
@ -164,6 +167,9 @@ void tc_lld_init(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SAMA_USE_TC1
|
#if SAMA_USE_TC1
|
||||||
|
#if SAMA_HAL_IS_SECURE
|
||||||
|
mtxConfigPeriphSecurity(MATRIX1, ID_TC1, SECURE_PER);
|
||||||
|
#endif /* SAMA_HAL_IS_SECURE */
|
||||||
/* Driver initialization.*/
|
/* Driver initialization.*/
|
||||||
tcObjectInit(&TCD1);
|
tcObjectInit(&TCD1);
|
||||||
TCD1.channels = TC_CHANNELS;
|
TCD1.channels = TC_CHANNELS;
|
||||||
|
|
|
@ -133,6 +133,23 @@ typedef void (*tccallback_t)(TCDriver *tcp);
|
||||||
#error "TC driver activated but no TC peripheral assigned"
|
#error "TC driver activated but no TC peripheral assigned"
|
||||||
#endif
|
#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. */
|
/* Driver data structures and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
Loading…
Reference in New Issue