Now that’s what I’m talking about

Array

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 image I have uses one 512-byte block per cluster, so this file does span two clusters and thus verifies that my cluster chain traversal is working. Well, for one step, anyway. 🙂

So, that’s a third of the requirements done – writing being the other two-thirds. I consider writing twice as significant not only because it’s part of the key requirements – to be able to write data to the onboard SD card – but also because it is significantly harder; to be able to write, you need to start modifying the FAT and directory entries, which is easy to screw up, and more complicated than simply reading them.

I might leave it at this for tonight, to save up writing for some other time. I’m estimating it’ll take roughly one full day (8-10 hours work) to get writing working, tested and verified.

I’ll also need a bit of extra time to implement a basic ftp-like shell over this, so that you can move real files from disk onto and off the Flash image. That hopefully won’t take too long to do in a simple but functional manner.

Successfully opened "/Code/Sleep.h".
#ifndef PRJ_SLEEP_H
#define PRJ_SLEEP_H

/*! @function sleep
@abstract 'Sleeps' (i.e. delays return) for the given number of milliseconds.
@discussion This function only guarantees it will wait at least the given number of milliseconds before returning - it may take longer to return based on numerous factors.
@param milliseconds The number of milliseconds to wait. */

void sleep(unsigned int milliseconds);

/*! @function usleep
@abstract 'Sleeps' (i.e. delays return) for the given number of microseconds.
@discussion This function only guarantees it will wait at least the given number of microseconds before returning - it may take longer to return based on numerous factors.
@param microseconds The number of microseconds to wait. */

void usleep(unsigned int microseconds);

#endif

Read 814 bytes in total
Successfully closed "/Code/Sleep.h".

Debugger stopped.
Program exited with status value:0.

Leave a Reply