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]

[Bug 1001070] BSP for Olimex LPC-L2294-8M


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001070

--- Comment #4 from Sergei Gavrikov <sergei.gavrikov@gmail.com> 2010-11-09 12:31:22 GMT ---
(In reply to comment #3)
> I've followed your suggestion, and it looks like nothing broken. I think adding
> another option(s) for the FLASH part is overkilling, what is your opinion?
> This is the 1st time I'm playing with eCos and CDL, I wrote this with the
> copy-and-paste method, so any other remarks from experienced eCos user are
> welcome.

As you could notice I added in that CDL component example a line:

    define -file system.h CYGHWR_BOARD.

NOTE: for real world it would be better to name it as CYGHWR_OLIMEX_BOARD
instead.

That will define in system.h header either CYGHWR_BOARD_OLPCL2294_1M constant
or CYGHWR_BOARD_OLPCL2294_8M according your choice. So, your code in
hal_platform_setup.h (and in FLASH device driver as well) can look like:

#if defined(CYGHWR_BOARD_OLPCL2294_1M)
    // code for 1M variant
#elif defined(CYGHWR_BOARD_OLPCL2294_8M)
    // code for 8M variant
#else
# error Not supported board.
#end

what is more clear than your checks:

#if CYGHWR_HAL_ARM_LPC2XXX_OLPCL2294_RAMSIZE == 0x00100000
...

Agreed? So, try to use those constants to differ the parts of code.

Check it: if you build eCos with defaults, then your <pkgconf/system.h> will
have:

#define CYGHWR_BOARD OLPCL2294_1M
#define CYGHWR_BOARD_OLPCL2294_1M

if you import below and rebuild eCos

cdl_component CYGHWR_HAL_ARM_LPC2XXX_OLPCL2294_VARIANT {
    user_value OLPCL2294_8M
};

then your <pkgconf/system.h> header will have yours

#define CYGHWR_BOARD OLPCL2294_8M
#define CYGHWR_BOARD_OLPCL2294_8M

So, you can use checks like in example the above in any source which includes
system.h.

Ah, once again, use there: 'define -file system.h CYGHWR_OLIMEX_BOARD' as
'CYGHWR_BOARD' is too generic name.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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