Skip to content

Commit

Permalink
offset for wordSize parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
soundanalogous committed Jan 16, 2017
1 parent 967a3f7 commit fe2a5a8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utility/SPIFirmata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
See file LICENSE.txt for further informations on licensing terms.
Last updated January 8th, 2017
Last updated January 15th, 2017
*/

#include "SPIFirmata.h"
Expand Down Expand Up @@ -68,12 +68,14 @@ bool SPIFirmata::handleSysex(uint8_t command, uint8_t argc, uint8_t *argv)
uint32_t clockSpeed = (uint32_t)argv[3] | ((uint32_t)argv[4] << 7) |
((uint32_t)argv[5] << 14) | ((uint32_t)argv[6] << 21) | ((uint32_t)argv[7] << 28);

if (argc > 8) {
mCsPin = argv[8];
// argv[8] = wordSize, but not currently used since SPI.transfer only uses 8-bit words

if (argc > 9) {
mCsPin = argv[9];
pinMode(mCsPin, OUTPUT);

if (argv[9] != END_SYSEX) {
mCsActiveState = argv[9];
if (argv[10] != END_SYSEX) {
mCsActiveState = argv[10];
} else {
// set default
mCsActiveState = SPI_CS_ACTIVE_LOW;
Expand Down

0 comments on commit fe2a5a8

Please sign in to comment.