-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* File Format Enumeration Header */ | ||
|
||
#ifndef VMCU_FMT_H | ||
#define VMCU_FMT_H | ||
|
||
typedef enum { | ||
|
||
VMCU_FMT_IHEX | ||
|
||
} VMCU_FMT; | ||
|
||
#endif |
4 changes: 2 additions & 2 deletions
4
engine/include/reader/ihex_reader.h → engine/include/reader/format/ihex.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* Format Reader Header */ | ||
|
||
#ifndef VMCU_READER_H | ||
#define VMCU_READER_H | ||
|
||
// C Headers | ||
#include <inttypes.h> | ||
|
||
// Project Headers | ||
#include "engine/include/reader/fmt.h" | ||
|
||
typedef struct vmcu_binary_buffer vmcu_binary_buffer_t; | ||
|
||
extern vmcu_binary_buffer_t* vmcu_read_format(const VMCU_FMT fmt, const char *file, uint32_t *size); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* Format Reader Implementation */ | ||
|
||
// C Headers | ||
#include <stddef.h> | ||
|
||
// Project Headers (engine) | ||
#include "engine/include/reader/reader.h" | ||
|
||
// Project Headers (engine, formats) | ||
#include "engine/include/reader/format/ihex.h" | ||
|
||
vmcu_binary_buffer_t* vmcu_read_format(const VMCU_FMT fmt, const char *file, uint32_t *size) { | ||
|
||
vmcu_binary_buffer_t *bb; | ||
|
||
switch(fmt) { | ||
|
||
case VMCU_FMT_IHEX: bb = vmcu_read_ihex(file, size); break; | ||
default: bb = NULL; break; | ||
} | ||
|
||
return bb; | ||
} |