Re: How to design non blocking device drivers?



On Sep 19, 12:11 am, Hans-Bernhard Bröker <HBBroe...@xxxxxxxxxxx>
wrote:
Lanarcam wrote:
Hans-Bernhard Bröker wrote:
1) fail: refuse the write job and return an error condition
2) block: wait for the other task, write, then finish successfully
3) cache: store the write's data and report success, although it
hasn't actually been written to EEPROM yet
You can also send your write requests through a queue
to a task whose job it is to do the actual writing.

... which is just an implementation of case 3).

There are many ways of signalling the end of the writing
through events or another queue.

He said he wanted the data written _to the EEPROM_ without blocking.
None of your proposals assures that.

The other (minor?) issue is that you cannot read from the EEPROM until
the write is finished, whether it is in a state machine or queued.
The only apparently viable solution is to mirror the EEPROM in RAM and
have a background task that slowly updates the EEPROM. Even caching
part of the EEPROM will not work because the entire EEPROM would be
unavailable.
.



Relevant Pages

  • Re: How to design non blocking device drivers?
    ... You have only one EEPROM, and one EEPROM can only do one write job at a time. ... store the write's data and report success, although it hasn't actually been written to EEPROM yet ... But your requirement to complete writing excludes 3) and 1), and you explicitly excluded 2), which leaves you with no way to do the job. ...
    (comp.arch.embedded)
  • Re: store 16bit values in 8bit eeprom
    ... void ReadFromEEPROM ... Perhaps temporarily replace read/write_eepromwith a couple of test functions that store a byte into an array, ... Then this will separate the problems of eeprom access, from any errors in your code. ...
    (comp.lang.c)
  • EEprom addressing
    ... I am unable to write a code for data read/write from EEprom. ... signed char eeprom_read ... // byte operation, clear interrupt flag ... // store bits 0-7 of address ...
    (sci.electronics.design)
  • Re: AVR (AT90S2313) EEPROM
    ... I would like to store values at a specific EEPROM address and to have ... I know how to declare a varible that will compile to be ... the STK500 plugin for AVR Studio can burn a specified hex file ...
    (comp.arch.embedded)
  • AVR (AT90S2313) EEPROM
    ... I have been doing a lot of searching and reading, ... I would like to store values at a specific EEPROM address and to have ...
    (comp.arch.embedded)