upgrading comm on packages (#708)

This commit is contained in:
Peli de Halleux 2018-06-20 13:59:20 -07:00 committed by GitHub
parent 299acea61f
commit f2344ac52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 70 deletions

View File

@ -16,10 +16,8 @@
"ns.ts", "ns.ts",
"control.cpp", "control.cpp",
"control.ts", "control.ts",
"eventcontext.ts", "console.ts",
"serial.cpp", "eventcontext.ts"
"serial.ts",
"fieldeditors.ts"
], ],
"testFiles": [ "testFiles": [
"test.ts" "test.ts"

17
libs/base/shims.d.ts vendored
View File

@ -142,23 +142,12 @@ declare namespace control {
//% blockId="control_device_serial_number" block="device serial number" weight=9 //% blockId="control_device_serial_number" block="device serial number" weight=9
//% help=control/device-serial-number shim=control::deviceSerialNumber //% help=control/device-serial-number shim=control::deviceSerialNumber
function deviceSerialNumber(): int32; function deviceSerialNumber(): int32;
}
declare namespace serial {
/** /**
* Write some text to the serial port. *
*/ */
//% help=serial/write-string //% shim=control::__log
//% weight=87 blockHidden=true function __log(text: string): void;
//% blockId=serial_writestring block="serial|write string %text" shim=serial::writeString
function writeString(text: string): void;
/**
* Send a buffer across the serial connection.
*/
//% help=serial/write-buffer weight=6 blockHidden=true
//% blockId=serial_writebuffer block="serial|write buffer %buffer" shim=serial::writeBuffer
function writeBuffer(buffer: Buffer): void;
} }
// Auto-generated. Do not edit. Really. // Auto-generated. Do not edit. Really.

View File

@ -1,48 +0,0 @@
/// <reference no-default-lib="true"/>
/**
* Reading and writing data to the console output.
*/
//% weight=12 color=#00451A icon="\uf112"
//% advanced=true
namespace console {
type Listener = (text: string) => void;
const listeners: Listener[] = [
(text: string) => serial.writeLine(text)
];
/**
* Write a line of text to the console output.
* @param value to send
*/
//% weight=90
//% help=console/log blockGap=8
//% blockId=console_log block="console|log %text"
export function log(text: string): void {
for (let i = 0; i < listeners.length; ++i)
listeners[i](text);
}
/**
* Write a name:value pair as a line of text to the console output.
* @param name name of the value stream, eg: "x"
* @param value to write
*/
//% weight=88 blockGap=8
//% help=console/log-value
//% blockId=console_log_value block="console|log value %name|= %value"
export function logValue(name: string, value: number): void {
log(`${name}: ${value}`)
}
/**
* Adds a listener for the log messages
* @param listener
*/
//%
export function addListener(listener: (text: string) => void) {
if (!listener) return;
listeners.push(listener);
}
}

1
libs/core/platform.h Normal file
View File

@ -0,0 +1 @@
// leave empty

View File

@ -10,7 +10,6 @@
"linux.cpp", "linux.cpp",
"mmap.cpp", "mmap.cpp",
"control.cpp", "control.cpp",
"console.ts",
"timer.ts", "timer.ts",
"serialnumber.cpp", "serialnumber.cpp",
"buttons.ts", "buttons.ts",
@ -25,7 +24,8 @@
"enums.d.ts", "enums.d.ts",
"dal.d.ts", "dal.d.ts",
"icons.jres", "icons.jres",
"ns.ts" "ns.ts",
"platform.h"
], ],
"testFiles": [ "testFiles": [
"test.ts" "test.ts"

1
libs/screen/image.d.ts vendored Normal file
View File

@ -0,0 +1 @@
// leave empty

View File

@ -39,8 +39,8 @@
"webfonts-generator": "^0.4.0" "webfonts-generator": "^0.4.0"
}, },
"dependencies": { "dependencies": {
"pxt-common-packages": "0.23.15", "pxt-common-packages": "0.23.37",
"pxt-core": "3.19.4" "pxt-core": "3.20.5"
}, },
"scripts": { "scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis" "test": "node node_modules/pxt-core/built/pxt.js travis"