-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial code to render a boot screen and charging screen (with some r…
…andom text)
- Loading branch information
1 parent
f851b59
commit 5f88ed7
Showing
8 changed files
with
137 additions
and
60 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,23 @@ | ||
|
||
#include "embedded_files.h" | ||
#include "emonesp.h" | ||
|
||
bool embedded_get_file(String filename, StaticFile *index, size_t length, StaticFile **file) | ||
{ | ||
DBUGF("Looking for %s", filename.c_str()); | ||
|
||
for(int i = 0; i < length; i++) | ||
{ | ||
if(filename == index[i].filename) | ||
{ | ||
DBUGF("Found %s %d@%p", index[i].filename, index[i].length, index[i].data); | ||
|
||
if(file) { | ||
*file = &index[i]; | ||
} | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} |
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,22 @@ | ||
#ifndef EMBEDDED_FILES_H | ||
#define EMBEDDED_FILES_H | ||
|
||
#include <Arduino.h> | ||
|
||
#define ARRAY_LENGTH(x) (sizeof(x)/sizeof((x)[0])) | ||
|
||
#define IS_ALIGNED(x) (0 == ((uint32_t)(x) & 0x3)) | ||
|
||
struct StaticFile | ||
{ | ||
const char *filename; | ||
const char *data; | ||
size_t length; | ||
const char *type; | ||
const char *etag; | ||
bool compressed; | ||
}; | ||
|
||
bool embedded_get_file(String filename, StaticFile *index, size_t length, StaticFile **file); | ||
|
||
#endif // EMBEDDED_FILES_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
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