The virtues of singular exits

I’m reminded now about the virtues of singular exits – that is, functions with only one exit point. I was a bit lazy while writing the FAT driver code, and put in a bazillion exit points. The only thing that was really surprising about that, in hindsight, is how long I managed to get away… Read more

CRC7? Are you mad?

For the last day or two I’ve been getting well versed on the MMC/SD card protocol. You can’t actually get official documentation, officially, but I’ve managed to find a few documents from SanDisk which do actually cover the important parts. There’s also heaps of existing implementations out there which I’ve been referring to, so development… Read more

FAT16 support

I’ve added FAT16 support to my driver. It was as expected a pretty trivial change, since the only real difference is the size of FAT entries and the location (and size) of the root directory. I haven’t tested I/O yet, but directory traversal works fine. I’ve also realised that the current system of treating directories… Read more

Who’s your daddy

So, a few days ago I showed file reading working with my FAT driver. Today, I give you writing. It took a little bit of tweaking to get right; I made a few mistakes here and there. I’m not 100% confident in it yet, but it’s at least working for the simple case – opening… Read more

Now that’s what I’m talking about

Ain’t it beautiful? I thought it wouldn’t take too much extra effort to be able to read data from files, and I was right! I’ve been working on it for no more than two hours, I shouldn’t think, and there it is. And even though this is only a small test file, luckily the Flash… Read more