From: <eig...@us...> - 2009-07-14 15:06:57
|
Revision: 23 http://firmata.svn.sourceforge.net/firmata/?rev=23&view=rev Author: eighthave Date: 2009-07-14 15:06:54 +0000 (Tue, 14 Jul 2009) Log Message: ----------- - added SHIFT_DATA to Firmata.h to claim for future implementations - renamed somethings for clarity and consistency (but left old names in for a bit) FIRMATA_STRING -> STRING_DATA SYSEX_I2C_REQUEST -> I2C_REQUEST SYSEX_I2C_REPLY -> I2C_REPLY SYSEX_SAMPLING_INTERVAL -> SAMPLING_INTERVAL Modified Paths: -------------- arduino/trunk/Firmata/Firmata.cpp arduino/trunk/Firmata/Firmata.h arduino/trunk/Firmata/examples/EchoString/EchoString.pde arduino/trunk/Firmata/examples/I2CFirmata/I2CFirmata.pde arduino/trunk/Firmata/examples/StandardFirmata/StandardFirmata.pde Modified: arduino/trunk/Firmata/Firmata.cpp =================================================================== --- arduino/trunk/Firmata/Firmata.cpp 2009-07-14 14:04:30 UTC (rev 22) +++ arduino/trunk/Firmata/Firmata.cpp 2009-07-14 15:06:54 UTC (rev 23) @@ -154,7 +154,7 @@ case REPORT_FIRMWARE: printFirmwareVersion(); break; - case FIRMATA_STRING: + case STRING_DATA: if(currentStringCallback) { byte bufferLength = (sysexBytesRead - 1) / 2; char *buffer = (char*)malloc(bufferLength * sizeof(char)); @@ -327,7 +327,7 @@ // send a string as the protocol string type void FirmataClass::sendString(const char* string) { - sendString(FIRMATA_STRING, string); + sendString(STRING_DATA, string); } @@ -355,7 +355,7 @@ void FirmataClass::attach(byte command, stringCallbackFunction newFunction) { switch(command) { - case FIRMATA_STRING: currentStringCallback = newFunction; break; + case STRING_DATA: currentStringCallback = newFunction; break; } } @@ -368,7 +368,7 @@ { switch(command) { case SYSTEM_RESET: currentSystemResetCallback = NULL; break; - case FIRMATA_STRING: currentStringCallback = NULL; break; + case STRING_DATA: currentStringCallback = NULL; break; case START_SYSEX: currentSysexCallback = NULL; break; default: attach(command, (callbackFunction)NULL); Modified: arduino/trunk/Firmata/Firmata.h =================================================================== --- arduino/trunk/Firmata/Firmata.h 2009-07-14 14:04:30 UTC (rev 22) +++ arduino/trunk/Firmata/Firmata.h 2009-07-14 15:06:54 UTC (rev 23) @@ -44,14 +44,20 @@ // extended command set using sysex (0-127/0x00-0x7F) /* 0x00-0x0F reserved for user-defined commands */ #define SERVO_CONFIG 0x70 // set max angle, minPulse, maxPulse, freq -#define FIRMATA_STRING 0x71 // a string message with 14-bits per char -#define SYSEX_I2C_REQUEST 0x76 // send an I2C read/write request -#define SYSEX_I2C_REPLY 0x77 // a reply to an I2C read request +#define STRING_DATA 0x71 // a string message with 14-bits per char +#define SHIFT_DATA 0x75 // a bitstream to/from a shift register +#define I2C_REQUEST 0x76 // send an I2C read/write request +#define I2C_REPLY 0x77 // a reply to an I2C read request #define I2C_CONFIG 0x78 // config I2C settings such as delay times and power pins #define REPORT_FIRMWARE 0x79 // report name and version of the firmware -#define SYSEX_SAMPLING_INTERVAL 0x7A // set the poll rate of the main loop +#define SAMPLING_INTERVAL 0x7A // set the poll rate of the main loop #define SYSEX_NON_REALTIME 0x7E // MIDI Reserved for non-realtime messages #define SYSEX_REALTIME 0x7F // MIDI Reserved for realtime messages +// these are DEPRECATED to make the naming more consistent +#define FIRMATA_STRING 0x71 // same as STRING_DATA +#define SYSEX_I2C_REQUEST 0x76 // same as I2C_REQUEST +#define SYSEX_I2C_REPLY 0x77 // same as I2C_REPLY +#define SYSEX_SAMPLING_INTERVAL 0x7A // same as SAMPLING_INTERVAL // pin modes //#define INPUT 0x00 // defined in wiring.h Modified: arduino/trunk/Firmata/examples/EchoString/EchoString.pde =================================================================== --- arduino/trunk/Firmata/examples/EchoString/EchoString.pde 2009-07-14 14:04:30 UTC (rev 22) +++ arduino/trunk/Firmata/examples/EchoString/EchoString.pde 2009-07-14 15:06:54 UTC (rev 23) @@ -25,7 +25,7 @@ void setup() { Firmata.setFirmwareVersion(0, 1); - Firmata.attach(FIRMATA_STRING, stringCallback); + Firmata.attach(STRING_DATA, stringCallback); Firmata.attach(START_SYSEX, sysexCallback); Firmata.begin(57600); } Modified: arduino/trunk/Firmata/examples/I2CFirmata/I2CFirmata.pde =================================================================== --- arduino/trunk/Firmata/examples/I2CFirmata/I2CFirmata.pde 2009-07-14 14:04:30 UTC (rev 22) +++ arduino/trunk/Firmata/examples/I2CFirmata/I2CFirmata.pde 2009-07-14 15:06:54 UTC (rev 23) @@ -66,7 +66,7 @@ i2cRxData[2 + i] = Wire.receive(); } // send slave address, register and received bytes - Firmata.sendSysex(SYSEX_I2C_REPLY, numBytes + 2, i2cRxData); + Firmata.sendSysex(I2C_REPLY, numBytes + 2, i2cRxData); } else { if(numBytes > Wire.available()) { @@ -86,7 +86,7 @@ byte data; int delayTime; - if (command == SYSEX_I2C_REQUEST) { + if (command == I2C_REQUEST) { mode = argv[1] & I2C_READ_WRITE_MODE_MASK; slaveAddress = argv[0]; @@ -133,7 +133,7 @@ break; } } - else if (command == SYSEX_SAMPLING_INTERVAL) { + else if (command == SAMPLING_INTERVAL) { samplingInterval = argv[0] + (argv[1] << 7); if (samplingInterval < MINIMUM_SAMPLING_INTERVAL) { Modified: arduino/trunk/Firmata/examples/StandardFirmata/StandardFirmata.pde =================================================================== --- arduino/trunk/Firmata/examples/StandardFirmata/StandardFirmata.pde 2009-07-14 14:04:30 UTC (rev 22) +++ arduino/trunk/Firmata/examples/StandardFirmata/StandardFirmata.pde 2009-07-14 15:06:54 UTC (rev 23) @@ -208,7 +208,7 @@ setPinModeCallback(pin, SERVO); } break; - case SYSEX_SAMPLING_INTERVAL: + case SAMPLING_INTERVAL: if (argc > 1) samplingInterval = argv[0] + (argv[1] << 7); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |