diff --git a/cores/arduino/CDCSerialClass.cpp b/cores/arduino/CDCSerialClass.cpp index 0ba6418b..c059cea8 100644 --- a/cores/arduino/CDCSerialClass.cpp +++ b/cores/arduino/CDCSerialClass.cpp @@ -86,8 +86,13 @@ void CDCSerialClass::begin(const uint32_t dwBaudRate, const uint8_t config) } -void CDCSerialClass::init(const uint32_t dwBaudRate, const uint8_t modeReg) +void CDCSerialClass::init(uint32_t dwBaudRate, const uint8_t modeReg) { + /* Set a max internal baud rate due to the limitation of the + * Inter Processor Mailbox */ + if(dwBaudRate > 115200) + dwBaudRate = 115200; + /* Set a per-byte write delay approximately equal to the time it would * take to clock out a byte on a standard UART at this baud rate */ _writeDelayUsec = 8000000 / dwBaudRate; diff --git a/cores/arduino/CDCSerialClass.h b/cores/arduino/CDCSerialClass.h index fb859d40..74eb7b3b 100644 --- a/cores/arduino/CDCSerialClass.h +++ b/cores/arduino/CDCSerialClass.h @@ -63,7 +63,7 @@ class CDCSerialClass : public HardwareSerial }; protected: - void init(const uint32_t dwBaudRate, const uint8_t config); + void init(uint32_t dwBaudRate, const uint8_t config); uart_init_info *info; uint32_t _writeDelayUsec; diff --git a/libraries/CurieBLE/examples/Peripheral/ButtonLED/ButtonLED.ino b/libraries/CurieBLE/examples/Peripheral/ButtonLED/ButtonLED.ino index 72a88a5e..fb91c18e 100644 --- a/libraries/CurieBLE/examples/Peripheral/ButtonLED/ButtonLED.ino +++ b/libraries/CurieBLE/examples/Peripheral/ButtonLED/ButtonLED.ino @@ -53,7 +53,7 @@ void loop() { char buttonValue = digitalRead(buttonPin); // has the value changed since the last read - boolean buttonChanged = (buttonCharacteristic.value() != buttonValue); + bool buttonChanged = (buttonCharacteristic.value() != buttonValue); if (buttonChanged) { // button state changed, update characteristics diff --git a/libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino b/libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino index 8cfc478e..52b8de4c 100644 --- a/libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino +++ b/libraries/CurieI2S/examples/I2SDMA_TXCallBack/I2SDMA_TXCallBack.ino @@ -10,7 +10,7 @@ #include const int BUFF_SIZE=64; -boolean blinkState = true; // state of the LED +bool blinkState = true; // state of the LED uint32_t dataBuff[BUFF_SIZE]; uint32_t loop_count = 0; void setup() diff --git a/libraries/CurieIMU/examples/FreeFallDetect/FreeFallDetect.ino b/libraries/CurieIMU/examples/FreeFallDetect/FreeFallDetect.ino index ca88e457..d964270a 100644 --- a/libraries/CurieIMU/examples/FreeFallDetect/FreeFallDetect.ino +++ b/libraries/CurieIMU/examples/FreeFallDetect/FreeFallDetect.ino @@ -10,7 +10,7 @@ #include "CurieIMU.h" -boolean blinkState = false; // state of the LED +bool blinkState = false; // state of the LED unsigned long loopTime = 0; // get the time since program started unsigned long interruptsTime = 0; // get the time when free fall event is detected diff --git a/libraries/CurieIMU/examples/MotionDetect/MotionDetect.ino b/libraries/CurieIMU/examples/MotionDetect/MotionDetect.ino index 400ad461..cb94d85a 100644 --- a/libraries/CurieIMU/examples/MotionDetect/MotionDetect.ino +++ b/libraries/CurieIMU/examples/MotionDetect/MotionDetect.ino @@ -10,7 +10,7 @@ #include "CurieIMU.h" -boolean blinkState = false; // state of the LED +bool blinkState = false; // state of the LED unsigned long loopTime = 0; // get the time since program started unsigned long interruptsTime = 0; // get the time when motion event is detected diff --git a/libraries/CurieIMU/examples/RawImuDataSerial/RawImuDataSerial.ino b/libraries/CurieIMU/examples/RawImuDataSerial/RawImuDataSerial.ino index d61da508..08eed73b 100644 --- a/libraries/CurieIMU/examples/RawImuDataSerial/RawImuDataSerial.ino +++ b/libraries/CurieIMU/examples/RawImuDataSerial/RawImuDataSerial.ino @@ -35,7 +35,7 @@ int ax, ay, az; // accelerometer values int gx, gy, gz; // gyrometer values const int ledPin = 13; // activity LED pin -boolean blinkState = false; // state of the LED +bool blinkState = false; // state of the LED int calibrateOffsets = 1; // int to determine whether calibration takes place or not diff --git a/libraries/CurieIMU/examples/ShockDetect/ShockDetect.ino b/libraries/CurieIMU/examples/ShockDetect/ShockDetect.ino index 467299a2..9f2d7a9e 100644 --- a/libraries/CurieIMU/examples/ShockDetect/ShockDetect.ino +++ b/libraries/CurieIMU/examples/ShockDetect/ShockDetect.ino @@ -10,7 +10,7 @@ #include "CurieIMU.h" -boolean blinkState = false; // state of the LED +bool blinkState = false; // state of the LED void setup() { Serial.begin(9600); // initialize Serial communication diff --git a/libraries/CurieIMU/examples/StepCount/StepCount.ino b/libraries/CurieIMU/examples/StepCount/StepCount.ino index aafc9483..9ebcadb0 100644 --- a/libraries/CurieIMU/examples/StepCount/StepCount.ino +++ b/libraries/CurieIMU/examples/StepCount/StepCount.ino @@ -20,9 +20,9 @@ */ const int ledPin = 13; -boolean stepEventsEnabeled = true; // whether you're polling or using events +bool stepEventsEnabeled = true; // whether you're polling or using events long lastStepCount = 0; // step count on previous polling check -boolean blinkState = false; // state of the LED +bool blinkState = false; // state of the LED void setup() { Serial.begin(9600); // initialize Serial communication diff --git a/libraries/CurieIMU/examples/ZeroMotionDetect/ZeroMotionDetect.ino b/libraries/CurieIMU/examples/ZeroMotionDetect/ZeroMotionDetect.ino index 56fc3a9d..1f7d11fe 100644 --- a/libraries/CurieIMU/examples/ZeroMotionDetect/ZeroMotionDetect.ino +++ b/libraries/CurieIMU/examples/ZeroMotionDetect/ZeroMotionDetect.ino @@ -9,7 +9,7 @@ */ #include "CurieIMU.h" -boolean ledState = false; // state of the LED +bool ledState = false; // state of the LED void setup() { Serial.begin(9600); // initialize Serial communication while(!Serial) ; // wait for serial port to connect. diff --git a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino index b135a74f..a06f1133 100644 --- a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino +++ b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino @@ -63,9 +63,11 @@ void loop() { void digitalPotWrite(int address, int value) { // take the SS pin low to select the chip: digitalWrite(slaveSelectPin, LOW); + delay(100); // send in the address and value via SPI: SPI.transfer(address); SPI.transfer(value); + delay(100); // take the SS pin high to de-select the chip: digitalWrite(slaveSelectPin, HIGH); } diff --git a/libraries/Wire/examples/bus_scan/bus_scan.ino b/libraries/Wire/examples/bus_scan/bus_scan.ino index 65fc0946..22ef7495 100644 --- a/libraries/Wire/examples/bus_scan/bus_scan.ino +++ b/libraries/Wire/examples/bus_scan/bus_scan.ino @@ -47,7 +47,7 @@ void setup() while(!Serial); } -boolean toggle = false; // state of the LED +bool toggle = false; // state of the LED void loop() { toggle = !toggle;