Apply gridpicker to "spi set pins" block. (#552)

Just forgot to include in the pull request https://github.com/Microsoft/pxt-microbit/pull/550
This commit is contained in:
Shigeru KANEMOTO 2017-10-17 01:50:53 +09:00 committed by Peli de Halleux
parent f5087f2b96
commit 51a42f7380
2 changed files with 13 additions and 1 deletions

View File

@ -429,6 +429,12 @@ namespace pins {
*/
//% help=pins/spi-pins weight=2 advanced=true
//% blockId=spi_pins block="spi set pins|MOSI %mosi|MISO %miso|SCK %sck"
//% mosi.fieldEditor="gridpicker" mosi.fieldOptions.columns=4
//% mosi.fieldOptions.tooltips="false" mosi.fieldOptions.width="300"
//% miso.fieldEditor="gridpicker" miso.fieldOptions.columns=4
//% miso.fieldOptions.tooltips="false" miso.fieldOptions.width="300"
//% sck.fieldEditor="gridpicker" sck.fieldOptions.columns=4
//% sck.fieldOptions.tooltips="false" sck.fieldOptions.width="300"
void spiPins(DigitalPin mosi, DigitalPin miso, DigitalPin sck) {
if (NULL != spi) {
delete spi;

View File

@ -755,7 +755,13 @@ declare namespace pins {
*
*/
//% help=pins/spi-pins weight=2 advanced=true
//% blockId=spi_pins block="spi set pins|MOSI %mosi|MISO %miso|SCK %sck" shim=pins::spiPins
//% blockId=spi_pins block="spi set pins|MOSI %mosi|MISO %miso|SCK %sck"
//% mosi.fieldEditor="gridpicker" mosi.fieldOptions.columns=4
//% mosi.fieldOptions.tooltips="false" mosi.fieldOptions.width="300"
//% miso.fieldEditor="gridpicker" miso.fieldOptions.columns=4
//% miso.fieldOptions.tooltips="false" miso.fieldOptions.width="300"
//% sck.fieldEditor="gridpicker" sck.fieldOptions.columns=4
//% sck.fieldOptions.tooltips="false" sck.fieldOptions.width="300" shim=pins::spiPins
function spiPins(mosi: DigitalPin, miso: DigitalPin, sck: DigitalPin): void;
}