From 2ff50b9c0f3a559ab7827aa44c83b66e5047d529 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 25 Jul 2017 10:46:00 -0700 Subject: [PATCH] adding block notation on ArrowNames (#462) --- libs/core/_locales/core-jsdoc-strings.json | 2 +- libs/core/_locales/core-strings.json | 10 ++++++++++ libs/core/icons.ts | 16 ++++++++-------- libs/core/shims.d.ts | 4 +++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/libs/core/_locales/core-jsdoc-strings.json b/libs/core/_locales/core-jsdoc-strings.json index 0afa7384..3544b19c 100644 --- a/libs/core/_locales/core-jsdoc-strings.json +++ b/libs/core/_locales/core-jsdoc-strings.json @@ -254,7 +254,7 @@ "serial.delimiters": "Returns the delimiter corresponding string", "serial.onDataReceived": "Registers an event to be fired when one of the delimiter is matched.", "serial.onDataReceived|param|delimiters": "the characters to match received characters against.", - "serial.readBuffer": "Reads multiple characters from the rxBuff and fills a user buffer.", + "serial.readBuffer": "Reads multiple characters from the receive buffer and fills a user buffer.", "serial.readBuffer|param|length": "default buffer length, eg: 64", "serial.readLine": "Reads a line of text from the serial port.", "serial.readString": "Reads the buffered received data as a string", diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index afeaa547..b99c5445 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -20,6 +20,14 @@ "AnalogPin.P7|block": "P7 (write only)", "AnalogPin.P8|block": "P8 (write only)", "AnalogPin.P9|block": "P9 (write only)", + "ArrowNames.East|block": "East", + "ArrowNames.NorthEast|block": "North East", + "ArrowNames.NorthWest|block": "North West", + "ArrowNames.North|block": "North", + "ArrowNames.SouthEast|block": "South East", + "ArrowNames.SouthWest|block": "South West", + "ArrowNames.South|block": "South", + "ArrowNames.West|block": "West", "BaudRate.BaudRate115200|block": "115200", "BaudRate.BaudRate1200|block": "1200", "BaudRate.BaudRate14400|block": "14400", @@ -297,10 +305,12 @@ "pins|block": "pins", "serial.delimiters|block": "%del", "serial.onDataReceived|block": "serial|on data received %delimiters=serial_delimiter_conv", + "serial.readBuffer|block": "serial|read buffer %length", "serial.readLine|block": "serial|read line", "serial.readString|block": "serial|read string", "serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv", "serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate", + "serial.writeBuffer|block": "serial|write buffer %buffer", "serial.writeLine|block": "serial|write line %text", "serial.writeNumber|block": "serial|write number %value", "serial.writeString|block": "serial|write string %text", diff --git a/libs/core/icons.ts b/libs/core/icons.ts index 1ade1e9f..ee64d25c 100644 --- a/libs/core/icons.ts +++ b/libs/core/icons.ts @@ -149,21 +149,21 @@ enum IconNames { } enum ArrowNames { - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="North" North = 0, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="North East" NorthEast, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="East" East, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="South East" SouthEast, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="South" South, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="South West" SouthWest, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="West" West, - //% blockIdentity=images.arrowNumber + //% blockIdentity=images.arrowNumber block="North West" NorthWest, } diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 0c68e546..3ee9b121 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -773,13 +773,15 @@ declare namespace serial { /** * Sends a buffer through Serial connection */ + //% blockId=serial_writebuffer block="serial|write buffer %buffer" //% help=serial/write-buffer advanced=true weight=6 shim=serial::writeBuffer function writeBuffer(buffer: Buffer): void; /** - * Reads multiple characters from the rxBuff and fills a user buffer. + * Reads multiple characters from the receive buffer and fills a user buffer. * @param length default buffer length, eg: 64 */ + //% blockId=serial_readbuffer block="serial|read buffer %length" //% help=serial/read-buffer advanced=true weight=5 shim=serial::readBuffer function readBuffer(length: number): Buffer;