Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
qucchia committed Jul 27, 2022
1 parent 7435ff4 commit ba30e2f
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Improvements to Documentation are amazingly helpful, and are very rare so hugely

### Functions/Variables

If you want to change something in a [built-in function's documentation](http://www.espruino.com/Reference), look at the heading for the function on that page and there will be a right-arrow (⇒).
If you want to change something in a [built-in function's documentation](http://www.espruino.com/Reference), look at the heading for the function on that page and there will be a right-arrow (⇒).

If you click on that it will bring you to the area of Espruino's source code where the function *and the documentation for it* are stored. You can then edit the documentation in that file (above the function) on GitHub and issue a pull request - it's in Markdown format.

Expand Down Expand Up @@ -56,7 +56,7 @@ Please [see here](http://www.espruino.com/Writing+Modules)
* Ensure that you are not contributing someone else's code, and that you are willing to add your code under Espruino's MPL Licence
* Make sure that what you do doesn't break the Espruino board or the other boards we build for. We can't check all the boards for every commit, so if you break something you'll annoy a whole bunch of people.
* Be aware that Espruino is designed for Microcontrollers - with very low amounts of flash and memory. Both are at a premium so don't statically allocate variables or do other stuff that will use up RAM.
* Don't add a whole bunch of indirection/abstraction for the sake of it - it'll probably just use of more of our precious memory.
* Don't add a whole bunch of indirection/abstraction for the sake of it - it'll probably just use more of our precious memory.
* If you add a new API, try and make it familiar to Arduino/JavaScript users.
* Please [RUN THE TESTS](tests/README.md) before and after your changes to check that there are no regressions
* Finally, please issue us a pull request to [www.github.com/espruino](https://www.github.com/espruino/Espruino) via GitHub. It's way easier for us to incorporate, give credit, and track changes that way.
Expand Down
2 changes: 1 addition & 1 deletion boards/RAK5010.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'DEFINES+=-DCONFIG_NFCT_PINS_AS_GPIOS', # Don't use NFC - the pins are used for GPS
'DEFINES += -DNRF_USB=1 -DUSB', # USB only works if connected at startup
'DEFINES+=-DESPR_REGOUT0_1_8V=1', # Force RAK5010 nRF52 voltage regulator to 1.8v, which stops glitches in modem serial comms
'NRF_SDK15=1'
'NRF_SDK15=1',
'DEFINES+=-DBLUETOOTH_NAME_PREFIX=\'"iTracker"\'',
'DFU_PRIVATE_KEY=targets/nrf5x_dfu/dfu_private_key.pem',
'DFU_SETTINGS=--application-version 0xff --hw-version 52 --sd-req 0x8C,0x91',
Expand Down
12 changes: 6 additions & 6 deletions libs/banglejs/jswrap_bangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ Bangle.setLCDPower(1); // keep screen on
**When on full, the LCD draws roughly 40mA.** You can adjust
When brightness using `Bange.setLCDBrightness`.
When brightness using `Bangle.setLCDBrightness`.
*/
void jswrap_banglejs_setLCDPower(bool isOn) {
#ifdef ESPR_BACKLIGHT_FADE
Expand Down Expand Up @@ -2147,7 +2147,7 @@ Set internal options used for gestures, etc...
* `wakeOnFaceUp` should the LCD turn on when the watch is turned face up? default = `false`
* `wakeOnTouch` should the LCD turn on when the touchscreen is pressed? default = `false`
* `wakeOnTwist` should the LCD turn on when the watch is twisted? default = `true`
* `twistThreshold` How much acceleration to register a twist of the watch strap? Can be negative for oppsite direction. default = `800`
* `twistThreshold` How much acceleration to register a twist of the watch strap? Can be negative for opposite direction. default = `800`
* `twistMaxY` Maximum acceleration in Y to trigger a twist (low Y means watch is facing the right way up). default = `-800`
* `twistTimeout` How little time (in ms) must a twist take from low->high acceleration? default = `1000`
* `gestureStartThresh` how big a difference before we consider a gesture started? default = `sqr(800)`
Expand All @@ -2157,7 +2157,7 @@ Set internal options used for gestures, etc...
* `powerSave` after a minute of not being moved, Bangle.js will change the accelerometer poll interval down to 800ms (10x accelerometer samples).
On movement it'll be raised to the default 80ms. If `Bangle.setPollInterval` is used this is disabled, and for it to work the poll interval
must be either 80ms or 800ms. default = `true`. Setting `powerSave:false` will disable this automatic power saving, but will **not** change
the poll interval from its current value. If you desire a specific interval (eg the default 80ms) you must set it manually with `Bangle.setPollInterval(80)`
the poll interval from its current value. If you desire a specific interval (e.g. the default 80ms) you must set it manually with `Bangle.setPollInterval(80)`
after setting `powerSave:false`.
* `lockTimeout` how many milliseconds before the screen locks
* `lcdPowerTimeout` how many milliseconds before the screen turns off
Expand Down Expand Up @@ -2275,7 +2275,7 @@ int jswrap_banglejs_isLCDOn() {
"ifdef" : "BANGLEJS"
}
This function can be used to lock or unlock Bangle.js
(eg whether buttons and touchscreen work or not)
(e.g. whether buttons and touchscreen work or not)
*/
void jswrap_banglejs_setLocked(bool isLocked) {
#if defined(TOUCH_I2C)
Expand Down Expand Up @@ -2675,7 +2675,7 @@ void jswrap_banglejs_resetCompass() {
"#if" : "defined(DTNO1_F5) || defined(BANGLEJS_Q3) || defined(DICKENS)",
"typescript" : "setBarometerPower(isOn: boolean, appID: string): boolean;"
}
Set the power to the barometer IC. Once enbled, `Bangle.pressure` events
Set the power to the barometer IC. Once enabled, `Bangle.pressure` events
are fired each time a new barometer reading is available.
When on, the barometer draws roughly 50uA
Expand Down Expand Up @@ -5327,7 +5327,7 @@ Currently supported interface types are:
* 'clockupdown' - called for clocks. Sets `Bangle.CLOCK=1`, allows a button to start the launcher, but also provides up/down functionality
* Bangle.js 1 BTN2 starts the launcher, BTN1/BTN3 call `cb(-1)` and `cb(1)`
* Bangle.js 2 BTN1 starts the launcher, touchscreen tap in top/bottom right hand side calls `cb(-1)` and `cb(1)`
* `{mode:"custom", ...}` allows you to specify custom handlers for different interations. See below.
* `{mode:"custom", ...}` allows you to specify custom handlers for different interactions. See below.
* `undefined` removes all user interaction code
While you could use setWatch/etc manually, the benefit here is that you don't end up with multiple `setWatch` instances, and
Expand Down
10 changes: 5 additions & 5 deletions libs/graphics/jswrap_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ int jswrap_graphics_getBPP(JsVar *parent) {
"return" : ["JsVar","The instance of Graphics this was called on, to allow call chaining"],
"return_object" : "Graphics"
}
Reset the state of Graphics to the defaults (eg. Color, Font, etc)
Reset the state of Graphics to the defaults (e.g. Color, Font, etc)
that would have been used when Graphics was initialised.
*/
JsVar *jswrap_graphics_reset(JsVar *parent) {
Expand Down Expand Up @@ -1503,7 +1503,7 @@ JsVarInt jswrap_graphics_getColorX(JsVar *parent, bool isForeground) {
This sets the 'clip rect' that subsequent drawing operations are clipped to
sit between.
These values are inclusive - eg `g.setClipRect(1,0,5,0)` will ensure that only
These values are inclusive - e.g. `g.setClipRect(1,0,5,0)` will ensure that only
pixel rows 1,2,3,4,5 are touched on column 0.
**Note:** For maximum flexibility on Bangle.js 1, the values here are not range checked. For normal
Expand Down Expand Up @@ -2195,7 +2195,7 @@ Draw a string of text in the current font.
g.drawString("Hello World", 10, 10);
```
Images may also be embedded inside strings (eg to render Emoji or characters not in the current font).
Images may also be embedded inside strings (e.g. to render Emoji or characters not in the current font).
To do this, just add `0` then the image string ([about Images](http://www.espruino.com/Graphics#images-bitmaps))
For example:
Expand Down Expand Up @@ -2467,7 +2467,7 @@ JsVar *jswrap_graphics_drawLineAA(JsVar *parent, double x1, double y1, double x2
"return" : ["JsVar","The instance of Graphics this was called on, to allow call chaining"],
"return_object" : "Graphics"
}
Draw a line from the last position of lineTo or moveTo to this position
Draw a line from the last position of `lineTo` or `moveTo` to this position
*/
JsVar *jswrap_graphics_lineTo(JsVar *parent, int x, int y) {
JsGraphics gfx; if (!graphicsGetFromVar(&gfx, parent)) return 0;
Expand Down Expand Up @@ -3712,7 +3712,7 @@ Returns an object of the form:
bg2 : 0x0007, // accented background colour
fgH : 0xFFFF, // highlighted foreground colour
bgH : 0x02F7, // highlighted background colour
dark : true, // Is background dark (eg. foreground should be a light colour)
dark : true, // Is background dark (e.g. foreground should be a light colour)
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/jswrap_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ bool jswrap_array_includes(JsVar *arr, JsVar *value, JsVarInt startIdx) {
"return" : ["JsVar","A String representing the Joined array"],
"typescript" : "join(separator?: string): string;"
}
Join all elements of this array together into one string, using 'separator' between them. eg. ```[1,2,3].join(' ')=='1 2 3'```
Join all elements of this array together into one string, using 'separator' between them. e.g. ```[1,2,3].join(' ')=='1 2 3'```
*/
JsVar *jswrap_array_join(JsVar *parent, JsVar *filler) {
if (!jsvIsIterable(parent)) return 0;
Expand Down
26 changes: 13 additions & 13 deletions src/jswrap_arraybuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ The length, in bytes, of the `ArrayBuffer`
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -287,7 +287,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Clamped arrays clamp their values to the allowed range, rather than 'wrapping'. e.g. after `a[0]=12345;`, `a[0]==255`.
*/
Expand All @@ -309,7 +309,7 @@ Clamped arrays clamp their values to the allowed range, rather than 'wrapping'.
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -329,7 +329,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -349,7 +349,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -370,7 +370,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint24Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -390,7 +390,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -410,7 +410,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -430,7 +430,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/
/*JSON{
"type" : "constructor",
Expand All @@ -450,7 +450,7 @@ Create a typed array based on the given input. Either an existing Array Buffer,
"new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;"
]
}
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (eg. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
Create a typed array based on the given input. Either an existing Array Buffer, an Integer as a Length, or a simple array. If an `ArrayBufferView` (e.g. `Uint8Array` rather than `ArrayBuffer`) is given, it will be completely copied rather than referenced.
*/

JsVar *jswrap_typedarray_constructor(JsVarDataArrayBufferViewType type, JsVar *arr, JsVarInt byteOffset, JsVarInt length) {
Expand Down Expand Up @@ -558,7 +558,7 @@ void jswrap_arraybufferview_set(JsVar *parent, JsVar *arr, int offset) {
return;
}
// Copy with the case where we copy from one arraybuffer to another but they use the
// same data. If we copy forward (eg `a.set(a.subarray(),1)`) then we
// same data. If we copy forward (e.g. `a.set(a.subarray(),1)`) then we
// end up duplicating the same data, so we must copy in reverse.
if (jsvIsArrayBuffer(parent) && jsvIsArrayBuffer(arr)) {
JsVar *sa = jsvGetArrayBufferBackingString(parent, NULL);
Expand Down Expand Up @@ -616,7 +616,7 @@ void jswrap_arraybufferview_set(JsVar *parent, JsVar *arr, int offset) {
}
Return an array which is made from the following: ```A.map(function) = [function(A[0]), function(A[1]), ...]```
**Note:** This returns an `ArrayBuffer` of the same type it was called on. To get an `Array`, use `Array.map`, eg. `[].map.call(myArray, x=>x+1)`
**Note:** This returns an `ArrayBuffer` of the same type it was called on. To get an `Array`, use `Array.map`, e.g. `[].map.call(myArray, x=>x+1)`
*/
JsVar *jswrap_arraybufferview_map(JsVar *parent, JsVar *funcVar, JsVar *thisVar) {
if (!jsvIsArrayBuffer(parent)) {
Expand Down Expand Up @@ -761,7 +761,7 @@ Return `true` if the array includes the value, `false` otherwise
"return" : ["JsVar","A String representing the Joined array"],
"typescript" : "join(separator?: string): string;"
}
Join all elements of this array together into one string, using 'separator' between them. eg. ```[1,2,3].join(' ')=='1 2 3'```
Join all elements of this array together into one string, using 'separator' between them. e.g. ```[1,2,3].join(' ')=='1 2 3'```
*/
/*JSON{
"type" : "method",
Expand Down
Loading

0 comments on commit ba30e2f

Please sign in to comment.