This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Redboot: No network interfaces found on olimex lpc-l2294 board
> Sergei's code:
>
> static __inline__ void post_reset(cyg_addrword_t base)
> {
> // Toggle A0 connected to the SBHE# line
> *(char *)0x82000000 = 1;
> *(char *)0x82000001 = 2;
> *(char *)0x82000000 = 3;
> *(char *)0x82000001 = 0;
> }
>
> Your code:
>
> static __inline__ void post_reset(cyg_addrword_t base)
> {
> // Toggle A0 connected to the SBHE# line
> (*(volatile char *)0x82000001) = 0x00;
> (*(volatile char *)0x82000000) = 0x00;
> (*(volatile char *)0x82000001) = 0x00;
> }
The correct thing to do here is use the HAL MACROS
HAL_WRITE_UINT8
HAL_WRITE_UINT16
HAL_WRITE_UINT32
and
HAL_READ_UINT8
HAL_READ_UINT16
HAL_READ_UINT32
These will take care of the volatile etc.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss