This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Flash callback function


Hi Folks

We have users of our hardware with impatient fingers. They are doing
software upgrades or configuration changes and immediately hitting the
reset button while a flash write or erase operation is active. Im
thinking of adding a callback function which is called at regular
intervals so that i can flash an LED. To do this i would need to
extend the flash API

typedef void _flash_callback(void);

flash_register_callback(_flast_callback *cf);

I would add a new entry to flash_info to hold the callback, and
within the code for the specific devices i'm uses call the callback
every time around the while loop.

The flash has a CDL option CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM, which
copies the implementation code into a local RAM buffer so that you
don't have problem of executing code in FLASH while you are
erasing/writing. I will leave it up to the implementor of the callback
to ensure they do this if required. There would be a warning comment
in the header file specifying this restriction and suggesting to do as
little as possible in the callback.

What's people opinion about this. Have i missed anything?

       Thanks
          Andrew


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