F´ Flight Software - C/C++ Documentation
NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
|
Go to the documentation of this file.
20 const U32 CHUNK_SIZE = 4096;
21 const U32 INITIAL_SEED = 0xFFFFFFFF;
22 const U32 MAX_IT = 0xFFFFFFFF;
25 U32 seed = INITIAL_SEED;
28 U8 file_buffer[CHUNK_SIZE];
31 for (U32 i = 0; !eof && i < MAX_IT; i++) {
34 if (status !=
OP_OK) {
39 status = file.
seek(offset,
true);
40 if (status !=
OP_OK) {
46 status = file.
read(file_buffer, chunk,
false);
50 if (chunk != 0 && status ==
OP_OK) {
54 }
else if (chunk == 0 && status ==
OP_OK) {
static Status niceCRC32(U32 &crc, const char *fileName)
Calculates CRC32 of file, not burdening FS.
void close(void)
close file
Status read(void *buffer, NATIVE_INT_TYPE &size, bool waitForFull=true)
waitForFull = true to wait for all bytes to be read
uint8_t U8
8-bit unsigned integer
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
Status seek(NATIVE_INT_TYPE offset, bool absolute=true)
seek to location. If absolute = true, absolute from beginning of file
Status open(const char *fileName, Mode mode)
open file. Writing creates file if it doesn't exist
Declares ISF basic types.
@ OP_OK
Operation was successful.
int NATIVE_INT_TYPE
native integer type declaration
@ OPEN_READ
Open file for reading.
unsigned long update_crc_32(unsigned long crc, char c)