I buy that, sounds good.


On Sat, Apr 12, 2014 at 2:46 PM, timburke <notifications@github.com> wrote:

> In momo_modules/shared/pic24/src/modules/memory.c:
>
> > @@ -149,12 +221,16 @@ void mem_write_aligned(const uint32 addr, const BYTE *data, unsigned int length)
> >      spi_transfer(data[i]);
> >
> >    DISABLE_MEMORY();
> > +
> > +  mem_wait_while_writing();
>
> It was intentional so that we can better reason about the state of the
> memory module in taskloop_loop(). Without this, you would have to check if
> the module was still writing before removing power to it and going to
> sleep. Also, the module locks itself while writing so you can't read from
> it either, meaning that all read functions would have to have a
> mem_wait_while_writing check in front of them too.
>
> It seemed that the clearer thing to do was simply have the write be
> synchronous and finish by the time the function returns.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/WellDone/MoMo-Firmware/pull/60/files#r11562142>
> .
>



-- 
Austin McGee
austinwm@gmail.com
(510) 200-8486