This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Motorola Coldfire MCF52xx I2C device driver


Hi Bart

On Tue, Oct 25, 2005 at 08:58:47AM +0200, uwe.kindler@cetoni.de wrote:
> Hello Andrew,
> 
> here is a new patch that contains all your changes.
> 
> About using is_loaded() in the CDL option CYGNUM_DEVS_I2C_MCF52xx_ISR_PRIORITY_MODULE:
> 
> I work with the eCos Pro starterkit for SSV DilNet PC. The ethernet
> driver supplied with this starter kit also uses is_loaded() for
> checking if the platform HAL provides a valid default interrupt
> priority.
> 
> Here is the part of the platform CDL file that defines the interrupt priority:
> 
> cdl_option CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_I2C {
> display "Default priority for I2C interrupts"
> flavor data
> calculated 45
> description "
> This configuration value provides a suitable default value for
> the I2C interrupt priority."
> }
> 
> So I thought it would be a good idea to do it the same way like the supplied drivers in eCos Pro starterkit.

Bart, the bit of CDL in question is:

            cdl_option CYGNUM_DEVS_I2C_MCF52xx_ISR_PRIORITY_MODULE[set ::i2c_mcf52xx] {
                display     "Interrupt priority"
                flavor      data
                default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_I2C) ? \
                                CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_I2C : \
                                CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
                legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
                description "
                    Interrupt priority for this I2C module."
            }

The question is about the use of is_loaded(). is_loaded() will return
true when the option exists. The option may be inactive, but is_loaded
will still return true. For me, using is_active() is more logic.

Comments please.

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]