-
Notifications
You must be signed in to change notification settings - Fork 1
/
jolt_lib_template.h
85 lines (67 loc) · 1.73 KB
/
jolt_lib_template.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef __JOLT_LIB_H__
#define __JOLT_LIB_H__
/* All of the functions available to an app */
#include "jelfloader.h"
#include "bipmnemonic.h"
#include "cJSON.h"
#include "driver/uart.h"
#include "esp_console.h"
#include "esp_log.h"
#include "esp_vfs_dev.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"
#include "freertos/task.h"
#include "linenoise/linenoise.h"
#include "math.h"
#include "mbedtls/bignum.h"
#include "nano_rest.h"
#include "qrcode.h"
#include "sodium.h"
#include "sodium/crypto_verify_32.h"
#include "sodium/private/curve25519_ref10.h"
#include "console.h"
#include "hal/storage/storage.h"
#include "hal/display.h"
#include "jolt_helpers.h"
#include "jolt_gui/jolt_gui.h"
#include "syscore/filesystem.h"
#include "vault.h"
#include "syscore/console_helpers.h"
#include "esp_http_client.h" // todo: replace with less open functions
typedef enum release_type_t {
JOLT_VERSION_RELEASE = 0,
JOLT_VERSION_DEV = 1,
} release_type_t;
typedef struct jolt_version_t {
union {
struct {
uint8_t major;
uint8_t minor;
uint8_t patch;
};
uint32_t version; // For easy comparison
};
release_type_t release;
} jolt_version_t;
extern const jolt_version_t JOLT_VERSION;
#if JOLT_OS
extern void *__floatsidf;
extern void *__gtdf2;
extern void *__ltdf2;
extern void *__muldf3;
extern void *__stack_chk_fail;
extern void *__stack_chk_guard;
#define EXPORT_SYMBOL(x) &x
/* This order is very important; only *append* fuctions */
static const void *exports[] = {
%s
};
static const jelfLoaderEnv_t env = {
.exported = exports,
.exported_size = sizeof(exports) / sizeof(*exports)
};
#else
/* Dummy place holder */
static const jelfLoaderEnv_t env;
#endif
#endif