add blocks for serial set tx/rx buffer size (#2144)
This commit is contained in:
parent
b553825f0c
commit
a0181ef2a7
@ -365,6 +365,8 @@
|
||||
"serial.readUntil|block": "serial|read until %delimiter=serial_delimiter_conv",
|
||||
"serial.redirectToUSB|block": "serial|redirect to USB",
|
||||
"serial.redirect|block": "serial|redirect to|TX %tx|RX %rx|at baud rate %rate",
|
||||
"serial.setRxBufferSize|block": "serial set rx buffer size to $size",
|
||||
"serial.setTxBufferSize|block": "serial set tx buffer size to $size",
|
||||
"serial.writeBuffer|block": "serial|write buffer %buffer=serial_readbuffer",
|
||||
"serial.writeLine|block": "serial|write line %text",
|
||||
"serial.writeNumbers|block": "serial|write numbers %values",
|
||||
|
@ -195,6 +195,8 @@ namespace serial {
|
||||
* @param size length of the rx buffer in bytes, eg: 32
|
||||
*/
|
||||
//% help=reference/serial/set-rx-buffer-size
|
||||
//% blockId=serialSetRxBufferSize block="serial set rx buffer size to $size"
|
||||
//% advanced=true
|
||||
void setRxBufferSize(uint8_t size) {
|
||||
uBit.serial.setRxBufferSize(size);
|
||||
}
|
||||
@ -204,8 +206,9 @@ namespace serial {
|
||||
* @param size length of the tx buffer in bytes, eg: 32
|
||||
*/
|
||||
//% help=reference/serial/set-tx-buffer-size
|
||||
//% blockId=serialSetTxBufferSize block="serial set tx buffer size to $size"
|
||||
//% advanced=true
|
||||
void setTxBufferSize(uint8_t size) {
|
||||
uBit.serial.setTxBufferSize(size);
|
||||
}
|
||||
|
||||
}
|
||||
|
8
libs/core/shims.d.ts
vendored
8
libs/core/shims.d.ts
vendored
@ -869,14 +869,18 @@ declare namespace serial {
|
||||
* Sets the size of the RX buffer in bytes
|
||||
* @param size length of the rx buffer in bytes, eg: 32
|
||||
*/
|
||||
//% help=reference/serial/set-rx-buffer-size shim=serial::setRxBufferSize
|
||||
//% help=reference/serial/set-rx-buffer-size
|
||||
//% blockId=serialSetRxBufferSize block="serial set rx buffer size to $size"
|
||||
//% advanced=true shim=serial::setRxBufferSize
|
||||
function setRxBufferSize(size: uint8): void;
|
||||
|
||||
/**
|
||||
* Sets the size of the TX buffer in bytes
|
||||
* @param size length of the tx buffer in bytes, eg: 32
|
||||
*/
|
||||
//% help=reference/serial/set-tx-buffer-size shim=serial::setTxBufferSize
|
||||
//% help=reference/serial/set-tx-buffer-size
|
||||
//% blockId=serialSetTxBufferSize block="serial set tx buffer size to $size"
|
||||
//% advanced=true shim=serial::setTxBufferSize
|
||||
function setTxBufferSize(size: uint8): void;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user