You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-14Lines changed: 23 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,8 @@ Copy the files you obtained to the `./src/javascript/` folder on this project (t
64
64
65
65
Here is a short documentation for each function that I've ported from their interface in [`eadk.h`](https://github.com/numworks/epsilon/blob/master/eadk/include/eadk/eadk.h) to a working version in JavaScript.
66
66
67
+
I've exposed an `Eadk` module (see example in JavaScript below, or [here](https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/3#issuecomment-2910813161)), which comes ready with these functions and constants:
68
+
67
69
> *Legend:*
68
70
> - ✅ = code written, function tested!
69
71
> - ✅? = code written, function not yet working!
@@ -72,7 +74,7 @@ Here is a short documentation for each function that I've ported from their inte
72
74
### ✅? Eadk predefined colors
73
75
`Eadk.color_black`, `Eadk.color_white`, `Eadk.color_red`, `Eadk.color_green`, `Eadk.color_blue` are the five predefined colors.
74
76
75
-
### ✅? Screen width and height
77
+
### ✅ Screen width and height
76
78
`Eadk.SCREEN_WIDTH` and `Eadk.SCREEN_HEIGHT` are the screen's width and height, respectively.
77
79
78
80
### ✅ Controlling the screen's brightness
@@ -85,31 +87,38 @@ Returns the screen's brightness, it's a 8 bits integer (`uint8_t` in C), ranging
85
87
Sets the screen's brightness to this value.
86
88
`brightness`**must** be an integer value which fits inside a `uint8_t`, between 0 and 256.
87
89
88
-
### ❌ Accessing the Battery levels
90
+
### ✅ Accessing the Battery levels
89
91
90
-
#### ❌`bool Eadk.battery_is_charging()`
92
+
#### ✅`bool Eadk.battery_is_charging()`
91
93
92
94
Indicates whether the battery is charging.
93
95
94
-
#### ❌`uint8_t Eadk.battery_level()`
96
+
#### ✅`uint8_t Eadk.battery_level()`
95
97
96
98
Returns a 8 bits integer giving the battery level.
97
99
98
-
#### ❌`float Eadk.battery_voltage()`
100
+
#### ✅`float Eadk.battery_voltage()`
99
101
100
102
Returns a floating value of the battery voltage (in Volt, I guess?).
101
103
102
104
> These functions are missing from the hardware!
103
105
> See [this issue on NumWorks/epsilon's repository](https://github.com/numworks/epsilon/issues/2326)
104
-
> TODO: [I could try to implement them myself, by SVC calls](https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5)
106
+
> DONE: [I just implemented them myself, by SVC calls](https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5)
Displays a given `text` string, at a `{x,y}` position, in large/small font (`large_font`?), with the text in `text_color` and the background in `background_color`.
Eadk.display_draw_string(text, x, y, large, text_color, background_color);
117
+
```
109
118
110
-
TODO: I still haven't been able to define this one correctly, due to the `char* text` that I don't know how to declare in JSON (in the JSON to C process used by `jswrap_` to generate the corresponding C code).
119
+
> TODO: it's still a bit buggy!
111
120
112
-
### Timing
121
+
### ✅ Timing
113
122
114
123
#### ✅ `void Eadk.timing_usleep(uint32_t us)`
115
124
@@ -123,17 +132,17 @@ Sleep for `ms` micro-seconds
123
132
124
133
Time since boot of the machine? Not clear. FIXME:
125
134
126
-
### Miscellanious
135
+
### ✅ Miscellanious
127
136
128
-
#### ❌`bool Eadk.usb_is_plugged()`
137
+
#### ✅`bool Eadk.usb_is_plugged()`
129
138
130
139
Indicates whether the USB is plugged.
131
140
132
141
> This function is missing from the hardware!
133
142
> See [this issue on NumWorks/epsilon's repository](https://github.com/numworks/epsilon/issues/2326)
134
-
> TODO: [I could try to implement it myself, by SVC calls](https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5)
143
+
> DONE: [I just implemented it myself, by SVC calls](https://github.com/Naereen/A-JavaScript-interpreter-for-the-NumWorks-calculator/issues/5)
135
144
136
-
#### ✅?`uint32_t Eadk.random()`
145
+
#### ✅ `uint32_t Eadk.random()`
137
146
138
147
Returns an almost truly random number, generated from the hardware RNG (a uint32_t, unsigned 32 bits integer).
result = (((JsVar*(*)(JsVar*,JsVar*,JsVar*))function)(((paramCount>0)?paramData[0]:0),((paramCount>1)?paramData[1]:0),((paramCount>2)?paramData[2]:0)));
0 commit comments