Commit 71a69a90 authored by carlosperate's avatar carlosperate

Fix SPI pin warnings.

parent 7d1f2c17
......@@ -66,11 +66,10 @@ Blockly.Arduino['spi_transfer'] = function(block) {
Blockly.Arduino.addSetup('spi_begin', spiId + '.begin();', false);
// Reserve SPI pins MOSI, MISO, and SCK
for (var i = 0; i < Blockly.Arduino.Boards.selected.spiPins.length; i++) {
Blockly.Arduino.reservePin(block,
Blockly.Arduino.Boards.selected.spiPins[i][1],
Blockly.Arduino.PinTypes.SPI,
'SPI ' + Blockly.Arduino.Boards.selected.spiPins[i][0]);
var spiPins = Blockly.Arduino.Boards.selected.spiPins[spiId];
for (var i = 0; i < spiPins.length; i++) {
Blockly.Arduino.reservePin(block, spiPins[i][1],
Blockly.Arduino.PinTypes.SPI, 'SPI ' + spiPins[i][0]);
}
// Configure the Slave Select as a normal output if a pin is used
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment