|
189 | 189 | },
|
190 | 190 | "reset": {
|
191 | 191 | "!type": "fn() -> +Graphics",
|
192 |
| - "!doc": "<p>Reset the state of Graphics to the defaults (e.g. Color, Font, etc) that would\nhave been used when Graphics was initialised.</p>\n", |
| 192 | + "!doc": "<p>Reset the state of Graphics to the defaults (e.g. Color, Font, etc) that would\nhave been used when Graphics was initialised.</p>\n<p><strong>Note:</strong> The current graphics theme is not reset when <code>g.reset()</code> is called. To reset that\nyou must store the value from <code>g.getTheme()</code> before calling <code>g.setTheme()</code>, and manually\nset it back afterwards.</p>\n", |
193 | 193 | "!url": "http://www.espruino.com/Reference#l_Graphics_reset"
|
194 | 194 | },
|
195 | 195 | "clear": {
|
|
3526 | 3526 | "!doc": "<p>Check the internal voltage reference. To work out an actual voltage of an input\npin, you can use <code>analogRead(pin)*E.getAnalogVRef()</code></p>\n<p> <strong>Note:</strong> This value is calculated by reading the voltage on an internal\nvoltage reference with the ADC. It will be slightly noisy, so if you need this\nfor accurate measurements we'd recommend that you call this function several\ntimes and average the results.</p>\n<p>While this is implemented on Espruino boards, it may not be implemented on other\ndevices. If so it'll return NaN.</p>\n",
|
3527 | 3527 | "!url": "http://www.espruino.com/Reference#l_E_getAnalogVRef"
|
3528 | 3528 | },
|
| 3529 | + "getVDDH": { |
| 3530 | + "!type": "fn() -> number", |
| 3531 | + "!doc": "<p>Return the voltage on VDDH input</p>\n<p><strong>Note:</strong> This value is calculated by reading the voltage on an internal\nvoltage reference with the ADC. It will be slightly noisy, so if you need this\nfor accurate measurements we'd recommend that you call this function several\ntimes and average the results.</p>\n", |
| 3532 | + "!url": "http://www.espruino.com/Reference#l_E_getVDDH" |
| 3533 | + }, |
3529 | 3534 | "nativeCall": {
|
3530 | 3535 | "!type": "fn(addr: number, sig: ?, data: ?) -> ?",
|
3531 | 3536 | "!doc": "<p>ADVANCED: It's very easy to crash Espruino using this function if\nyou get the code/arguments you supply wrong!</p>\n<p>Create a native function that executes the code at the given address, e.g.\n<code>E.nativeCall(0x08012345,'double (double,double)')(1.1, 2.2)</code></p>\n<p>If you're executing a thumb function, you'll almost certainly need to set the\nbottom bit of the address to 1.</p>\n<p>Note it's not guaranteed that the call signature you provide can be used - there\nare limits on the number of arguments allowed (5).</p>\n<p>When supplying <code>data</code>, if it is a 'flat string' then it will be used directly,\notherwise it'll be converted to a flat string and used.</p>\n<p>The argument types in <code>sig</code> are:</p>\n<ul>\n<li><code>void</code> - returns nothing</li>\n<li><code>bool</code> - boolean value</li>\n<li><code>int</code> - 32 bit integer</li>\n<li><code>double</code> - 64 bit floating point</li>\n<li><code>float</code> - 32 bit floating point (2v21 and later)</li>\n<li><code>Pin</code> - Espruino 'pin' value (8 bit integer)</li>\n<li><code>JsVar</code> - Pointer to an Espruino JsVar structure</li>\n</ul>\n",
|
|
3543 | 3548 | },
|
3544 | 3549 | "variance": {
|
3545 | 3550 | "!type": "fn(arr: ?, mean: number) -> number",
|
3546 |
| - "!doc": "<p>Work out the variance of the contents of the given Array, String or ArrayBuffer\nand return the result. This is equivalent to <code>v=0;for (i in arr) v+=Math.pow(mean-arr[i],2)</code></p>\n", |
| 3551 | + "!doc": "<p>Work out the variance of the contents of the given Array, String or ArrayBuffer\nand return the result. This is equivalent to:</p>\n<pre><code><span class=\"hljs-attribute\">v</span>=<span class=\"hljs-number\">0</span>;\n<span class=\"hljs-attribute\">for</span> (i in arr)\n <span class=\"hljs-attribute\">v</span>+=Math.pow(mean-arr[i],<span class=\"hljs-number\">2</span>);\n</code></pre>\n", |
3547 | 3552 | "!url": "http://www.espruino.com/Reference#l_E_variance"
|
3548 | 3553 | },
|
3549 | 3554 | "convolve": {
|
|
3578 | 3583 | },
|
3579 | 3584 | "getFlags": {
|
3580 | 3585 | "!type": "fn() -> ?",
|
3581 |
| - "!doc": "<p>Get Espruino's interpreter flags that control the way it handles your JavaScript\ncode.</p>\n<ul>\n<li><code>deepSleep</code> - Allow deep sleep modes (also set by setDeepSleep)</li>\n<li><code>pretokenise</code> - When adding functions, pre-minify them and tokenise reserved\nwords</li>\n<li><code>unsafeFlash</code> - Some platforms stop writes/erases to interpreter memory to\nstop you bricking the device accidentally - this removes that protection</li>\n<li><code>unsyncFiles</code> - When writing files, <em>don't</em> flush all data to the SD card\nafter each command (the default is <em>to</em> flush). This is much faster, but can\ncause filesystem damage if power is lost without the filesystem unmounted.</li>\n</ul>\n", |
| 3586 | + "!doc": "<p>Get Espruino's interpreter flags that control the way it handles your JavaScript\ncode.</p>\n<ul>\n<li><code>deepSleep</code> - Allow deep sleep modes (also set by setDeepSleep)</li>\n<li><code>pretokenise</code> - When adding functions, pre-minify them and tokenise reserved\nwords</li>\n<li><code>unsafeFlash</code> - Some platforms stop writes/erases to interpreter memory to\nstop you bricking the device accidentally - this removes that protection</li>\n<li><code>unsyncFiles</code> - When writing files, <em>don't</em> flush all data to the SD card\nafter each command (the default is <em>to</em> flush). This is much faster, but can\ncause filesystem damage if power is lost without the filesystem unmounted.</li>\n<li><code>jitDebug</code> - When JIT compiling, outputs debug info to the console</li>\n<li><code>onErrorSave</code> - [2v27+] when an uncaught error occurs, write it to a\nfile called <code>ERROR</code> in Storage (the file is not updated)</li>\n<li><code>onErrorFlash</code> - [2v27+] when an uncaught error occurs, flash the red LED\nfor 200ms (only on devices with a physical LED)</li>\n</ul>\n", |
3582 | 3587 | "!url": "http://www.espruino.com/Reference#l_E_getFlags"
|
3583 | 3588 | },
|
3584 | 3589 | "setFlags": {
|
|
3683 | 3688 | },
|
3684 | 3689 | "dumpFragmentation": {
|
3685 | 3690 | "!type": "fn()",
|
3686 |
| - "!doc": "<p>Show fragmentation.</p>\n<ul>\n<li><code> </code> is free space</li>\n<li><code>#</code> is a normal variable</li>\n<li><code>L</code> is a locked variable (address used, cannot be moved)</li>\n<li><code>=</code> represents data in a Flat String (must be contiguous)</li>\n</ul>\n", |
| 3691 | + "!doc": "<p>Show fragmentation. As of 2v27 this stops at the last allocated variable\nso as to avoid outputting blank lines if memory isn't full.</p>\n<ul>\n<li><code> </code> is free space</li>\n<li><code>#</code> is a normal variable</li>\n<li><code>L</code> is a locked variable (address used, cannot be moved)</li>\n<li><code>=</code> represents data in a Flat String (must be contiguous)</li>\n</ul>\n", |
3687 | 3692 | "!url": "http://www.espruino.com/Reference#l_E_dumpFragmentation"
|
3688 | 3693 | },
|
3689 | 3694 | "dumpVariables": {
|
|
3693 | 3698 | },
|
3694 | 3699 | "defrag": {
|
3695 | 3700 | "!type": "fn()",
|
3696 |
| - "!doc": "<p>BETA: defragment memory!</p>\n", |
| 3701 | + "!doc": "<p>This defragment's Espruino's memory.</p>\n<p>While Espruino does a lot of work to avoid fragmentation (variables spread over memory)\nand can usually work around it (such as by allocating data in chunks) sometimes\nit is useful to be able to allocate a large contiguous chunk of memory, and\nif memory is low and has been fragmented it may need defragmenting in order to\nfind that chunk.</p>\n<p>See <code>E.dumpFragmentation()</code> to show a map of the arrangement of variables\nwithin memory.</p>\n", |
3697 | 3702 | "!url": "http://www.espruino.com/Reference#l_E_defrag"
|
3698 | 3703 | },
|
3699 | 3704 | "getSizeOf": {
|
|
4152 | 4157 | "!type": "fn(text: ?)",
|
4153 | 4158 | "!doc": "<p>Implemented in Espruino as an alias of <code>console.log</code></p>\n",
|
4154 | 4159 | "!url": "http://www.espruino.com/Reference#l_console_error"
|
| 4160 | + }, |
| 4161 | + "trace": { |
| 4162 | + "!type": "fn(text: ?)", |
| 4163 | + "!doc": "", |
| 4164 | + "!url": "http://www.espruino.com/Reference#l_console_trace" |
4155 | 4165 | }
|
4156 | 4166 | },
|
4157 | 4167 | "OneWire": {
|
|
0 commit comments