Optional Clock_driver_support_shutdown_hardware()

Make Clock_driver_support_shutdown_hardware() optional.  This avoids
the atexit() support on memory constrained targets.
This commit is contained in:
Sebastian Huber
2017-08-03 14:48:04 +02:00
parent a8694035ae
commit 30be024aa4
8 changed files with 37 additions and 32 deletions

View File

@@ -67,13 +67,12 @@ static void Clock_driver_support_initialize_hardware(void)
lm32_interrupt_unmask(CLOCK_IRQMASK);
}
static void Clock_driver_support_shutdown_hardware(void)
{
/* Disable clock interrupts and stop */
lm32_interrupt_unmask(CLOCK_IRQMASK);
clockwrite(LM32_CLOCK_CR, LM32_CLOCK_CR_STOP);
}
#define Clock_driver_support_shutdown_hardware() \
do { \
/* Disable clock interrupts and stop */ \
lm32_interrupt_unmask(CLOCK_IRQMASK); \
clockwrite(LM32_CLOCK_CR, LM32_CLOCK_CR_STOP); \
} while (0)
#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER

View File

@@ -40,11 +40,11 @@ static void Clock_driver_support_initialize_hardware(void)
bsp_interrupt_vector_enable(MM_IRQ_TIMER0);
}
static void Clock_driver_support_shutdown_hardware(void)
{
bsp_interrupt_vector_disable(MM_IRQ_TIMER0);
MM_WRITE(MM_TIMER0_CONTROL, 0);
}
#define Clock_driver_support_shutdown_hardware() \
do { \
bsp_interrupt_vector_disable(MM_IRQ_TIMER0); \
MM_WRITE(MM_TIMER0_CONTROL, 0); \
} while (0)
#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER