arch/z80/src/ez80/ez80_timerisr.c: Use Kconfig MCU configurations.

Don't use MCU selection from compiler.  It appears that we must compile ez80f92 code as ez80f91 so the comiler MCU selection is incorrect.  Instead, use the selected CPU part from the configuration.
This commit is contained in:
Gregory Nutt 2020-02-26 10:44:02 -06:00 committed by Ouss4
parent b63024dc7b
commit fcee2f5a53
1 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/ez80/ez80_timerisr.c
*
* Copyright (C) 2008-2009, 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2017, 2020 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -66,7 +66,7 @@ static int ez80_timerisr(int irq, chipreg_t *regs, void *arg)
{
/* Read the appropriate timer0 register to clear the interrupt */
#ifdef _EZ80F91
#ifdef CONFIGS_ARCH_CHIP_EZ80F91
inp(EZ80_TMR0_IIR);
#else
/* _EZ80190, _EZ80L92, _EZ80F92, _EZ80F93 */
@ -78,9 +78,9 @@ static int ez80_timerisr(int irq, chipreg_t *regs, void *arg)
nxsched_process_timer();
#ifdef CONFIG_ARCH_TIMERHOOK
/* Architecture specific hook into the timer interrupt handler */
#ifdef CONFIG_ARCH_TIMERHOOK
up_timerhook();
#endif
@ -137,9 +137,10 @@ void up_timer_initialize(void)
/* Clear any pending timer interrupts */
#if defined(_EZ80F91)
#if defined(CONFIGS_ARCH_CHIP_EZ80F91)
inp(EZ80_TMR0_IIR);
#elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93)
#elif defined(CONFIGS_ARCH_CHIP_EZ80L92) || defined(CONFIGS_ARCH_CHIP_EZ80F92) || \
defined(CONFIGS_ARCH_CHIP_EZ80F93)
inp(EZ80_TMR0_CTL);
#endif
@ -147,15 +148,16 @@ void up_timer_initialize(void)
#if defined(_EZ80190)
outp(EZ80_TMR0_CTL, 0x5f);
#elif defined(_EZ80F91)
#elif defined(CONFIGS_ARCH_CHIP_EZ80F91)
outp(EZ80_TMR0_CTL, (EZ80_TMRCLKDIV_16|EZ80_TMRCTL_TIMCONT|EZ80_TMRCTL_RLD|EZ80_TMRCTL_TIMEN));
#elif defined(_EZ80L92) || defined(_EZ80F92) ||defined(_EZ80F93)
#elif defined(CONFIGS_ARCH_CHIP_EZ80L92) || defined(CONFIGS_ARCH_CHIP_EZ80F92) || \
defined(CONFIGS_ARCH_CHIP_EZ80F93)
outp(EZ80_TMR0_CTL, 0x57);
#endif
/* Enable timer end-of-count interrupts */
#if defined(_EZ80F91)
#if defined(CONFIGS_ARCH_CHIP_EZ80F91)
outp(EZ80_TMR0_IER, EZ80_TMRIER_EOCEN);
#endif
}