From bbc017f5ba3c0fc3373976d4ef7e28237899d733 Mon Sep 17 00:00:00 2001 From: Greyson Christoforo Date: Sat, 9 Jan 2021 11:31:39 +0000 Subject: fix twi_manageTimeoutFlag function description --- libraries/Wire/src/utility/twi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries') diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index e8a41a2..d223760 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -490,7 +490,7 @@ void twi_handleTimeout(bool reset){ * Desc returns true if twi has seen a timeout * optionally clears the timeout flag * Input clear_flag: true if we should reset the hardware - * Output none + * Output the value of twi_timed_out_flag when the function was called */ bool twi_manageTimeoutFlag(bool clear_flag){ bool flag = twi_timed_out_flag; -- cgit v1.2.3-18-g5258 From 4b35c44064ad638c63bae7aa337002fbcc665ffb Mon Sep 17 00:00:00 2001 From: ArkadyGamza Date: Thu, 25 Feb 2021 15:55:51 +0000 Subject: Declare TwoWire functions as virtual To make alternative implementations of the TwoWire class (e.g. SoftwareWire for software I2C) work properly being passed to libraries that expect TwoWire type. --- libraries/Wire/src/Wire.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'libraries') diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index e70d72e..30299ca 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -50,31 +50,31 @@ class TwoWire : public Stream static void onReceiveService(uint8_t*, int); public: TwoWire(); - void begin(); - void begin(uint8_t); - void begin(int); - void end(); - void setClock(uint32_t); - void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); - bool getWireTimeoutFlag(void); - void clearWireTimeoutFlag(void); - void beginTransmission(uint8_t); - void beginTransmission(int); - uint8_t endTransmission(void); - uint8_t endTransmission(uint8_t); - uint8_t requestFrom(uint8_t, uint8_t); - uint8_t requestFrom(uint8_t, uint8_t, uint8_t); - uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); - uint8_t requestFrom(int, int); - uint8_t requestFrom(int, int, int); + virtual void begin(); + virtual void begin(uint8_t); + virtual void begin(int); + virtual void end(); + virtual void setClock(uint32_t); + virtual void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); + virtual bool getWireTimeoutFlag(void); + virtual void clearWireTimeoutFlag(void); + virtual void beginTransmission(uint8_t); + virtual void beginTransmission(int); + virtual uint8_t endTransmission(void); + virtual uint8_t endTransmission(uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t, uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); + virtual uint8_t requestFrom(int, int); + virtual uint8_t requestFrom(int, int, int); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); virtual int read(void); virtual int peek(void); virtual void flush(void); - void onReceive( void (*)(int) ); - void onRequest( void (*)(void) ); + virtual void onReceive( void (*)(int) ); + virtual void onRequest( void (*)(void) ); inline size_t write(unsigned long n) { return write((uint8_t)n); } inline size_t write(long n) { return write((uint8_t)n); } -- cgit v1.2.3-18-g5258 From 1ac42f7ac0c365cfa4d901889ff6d4c23d3b4796 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 26 May 2021 13:19:49 +0200 Subject: Revert "Declare TwoWire functions as virtual" (#412) --- libraries/Wire/src/Wire.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'libraries') diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index 30299ca..e70d72e 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -50,31 +50,31 @@ class TwoWire : public Stream static void onReceiveService(uint8_t*, int); public: TwoWire(); - virtual void begin(); - virtual void begin(uint8_t); - virtual void begin(int); - virtual void end(); - virtual void setClock(uint32_t); - virtual void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); - virtual bool getWireTimeoutFlag(void); - virtual void clearWireTimeoutFlag(void); - virtual void beginTransmission(uint8_t); - virtual void beginTransmission(int); - virtual uint8_t endTransmission(void); - virtual uint8_t endTransmission(uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t, uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); - virtual uint8_t requestFrom(int, int); - virtual uint8_t requestFrom(int, int, int); + void begin(); + void begin(uint8_t); + void begin(int); + void end(); + void setClock(uint32_t); + void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); + bool getWireTimeoutFlag(void); + void clearWireTimeoutFlag(void); + void beginTransmission(uint8_t); + void beginTransmission(int); + uint8_t endTransmission(void); + uint8_t endTransmission(uint8_t); + uint8_t requestFrom(uint8_t, uint8_t); + uint8_t requestFrom(uint8_t, uint8_t, uint8_t); + uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); + uint8_t requestFrom(int, int); + uint8_t requestFrom(int, int, int); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); virtual int read(void); virtual int peek(void); virtual void flush(void); - virtual void onReceive( void (*)(int) ); - virtual void onRequest( void (*)(void) ); + void onReceive( void (*)(int) ); + void onRequest( void (*)(void) ); inline size_t write(unsigned long n) { return write((uint8_t)n); } inline size_t write(long n) { return write((uint8_t)n); } -- cgit v1.2.3-18-g5258 From 8b327d7bede1c1245db99daeba4e168c92c11194 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 04:35:59 -0700 Subject: Correct typos in comments and documentation --- libraries/EEPROM/README.md | 6 +++--- libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino | 6 +++--- .../EEPROM/examples/eeprom_iteration/eeprom_iteration.ino | 2 +- libraries/EEPROM/examples/eeprom_read/eeprom_read.ino | 6 +++--- libraries/EEPROM/examples/eeprom_update/eeprom_update.ino | 8 ++++---- libraries/EEPROM/examples/eeprom_write/eeprom_write.ino | 6 +++--- libraries/HID/src/HID.cpp | 2 +- .../BarometricPressureSensor/BarometricPressureSensor.ino | 3 +-- libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino | 6 +++--- libraries/SPI/src/SPI.h | 2 +- .../examples/SoftwareSerialExample/SoftwareSerialExample.ino | 3 +-- .../SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino | 10 ++-------- libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino | 8 ++++---- .../examples/digital_potentiometer/digital_potentiometer.ino | 3 +-- libraries/Wire/examples/i2c_scanner/i2c_scanner.ino | 6 +++--- libraries/Wire/examples/master_reader/master_reader.ino | 2 +- libraries/Wire/examples/master_writer/master_writer.ino | 2 +- libraries/Wire/examples/slave_receiver/slave_receiver.ino | 2 +- libraries/Wire/examples/slave_sender/slave_sender.ino | 2 +- libraries/Wire/src/Wire.cpp | 4 ++-- libraries/Wire/src/utility/twi.c | 10 +++++----- 21 files changed, 45 insertions(+), 54 deletions(-) (limited to 'libraries') diff --git a/libraries/EEPROM/README.md b/libraries/EEPROM/README.md index a624136..9ca761d 100644 --- a/libraries/EEPROM/README.md +++ b/libraries/EEPROM/README.md @@ -53,7 +53,7 @@ This function does not return any value. This function will retrieve any object from the EEPROM. Two parameters are needed to call this function. The first is an `int` containing the address that is to be written, and the second is the object you would like to read. -This function returns a reference to the `object` passed in. It does not need to be used and is only returned for conveience. +This function returns a reference to the `object` passed in. It does not need to be used and is only returned for convenience. #### **`EEPROM.put( address, object )`** [[_example_]](examples/eeprom_put/eeprom_put.ino) @@ -62,7 +62,7 @@ Two parameters are needed to call this function. The first is an `int` containin This function uses the _update_ method to write its data, and therefore only rewrites changed cells. -This function returns a reference to the `object` passed in. It does not need to be used and is only returned for conveience. +This function returns a reference to the `object` passed in. It does not need to be used and is only returned for convenience. #### **Subscript operator: `EEPROM[address]`** [[_example_]](examples/eeprom_crc/eeprom_crc.ino) @@ -136,4 +136,4 @@ This is useful for STL objects, custom iteration and C++11 style ranged for loop This function returns an `EEPtr` pointing at the location after the last EEPROM cell. Used with `begin()` to provide custom iteration. -**Note:** The `EEPtr` returned is invalid as it is out of range. Infact the hardware causes wrapping of the address (overflow) and `EEPROM.end()` actually references the first EEPROM cell. +**Note:** The `EEPtr` returned is invalid as it is out of range. In fact the hardware causes wrapping of the address (overflow) and `EEPROM.end()` actually references the first EEPROM cell. diff --git a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino index 8b5121c..3fed10f 100644 --- a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino +++ b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino @@ -18,9 +18,9 @@ void setup() { Iterate through each byte of the EEPROM storage. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino index 3673b47..b5d68be 100644 --- a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino +++ b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino @@ -54,4 +54,4 @@ void setup() { } //End of setup function. -void loop() {} \ No newline at end of file +void loop() {} diff --git a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino index a8a3510..d465035 100644 --- a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino +++ b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino @@ -33,9 +33,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino b/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino index 5e3db5b..f5b0c0c 100644 --- a/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino +++ b/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino @@ -17,7 +17,7 @@ int address = 0; void setup() { - /** EMpty setup **/ + /** Empty setup **/ } void loop() { @@ -48,9 +48,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino b/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino index f9bea64..64e835c 100644 --- a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino +++ b/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino @@ -36,9 +36,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/HID/src/HID.cpp b/libraries/HID/src/HID.cpp index 21ede26..3dd85fc 100644 --- a/libraries/HID/src/HID.cpp +++ b/libraries/HID/src/HID.cpp @@ -43,7 +43,7 @@ int HID_::getDescriptor(USBSetup& setup) if (setup.bmRequestType != REQUEST_DEVICETOHOST_STANDARD_INTERFACE) { return 0; } if (setup.wValueH != HID_REPORT_DESCRIPTOR_TYPE) { return 0; } - // In a HID Class Descriptor wIndex cointains the interface number + // In a HID Class Descriptor wIndex contains the interface number if (setup.wIndex != pluggedInterface) { return 0; } int total = 0; diff --git a/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino index df73ade..1b8ad70 100644 --- a/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino +++ b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino @@ -43,7 +43,7 @@ void setup() { // start the SPI library: SPI.begin(); - // initalize the data ready and chip select pins: + // initialize the data ready and chip select pins: pinMode(dataReadyPin, INPUT); pinMode(chipSelectPin, OUTPUT); @@ -140,4 +140,3 @@ void writeRegister(byte thisRegister, byte thisValue) { // take the chip select high to de-select: digitalWrite(chipSelectPin, HIGH); } - diff --git a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino index 8719058..39e5bf9 100644 --- a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino +++ b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino @@ -14,7 +14,7 @@ The circuit: * All A pins of AD5206 connected to +5V * All B pins of AD5206 connected to ground - * An LED and a 220-ohm resisor in series connected from each W pin to ground + * An LED and a 220-ohm resistor in series connected from each W pin to ground * CS - to digital pin 10 (SS pin) * SDI - to digital pin 11 (MOSI pin) * CLK - to digital pin 13 (SCK pin) @@ -27,7 +27,7 @@ */ -// inslude the SPI library: +// include the SPI library: #include @@ -64,7 +64,7 @@ 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: + // send in the address and value via SPI: SPI.transfer(address); SPI.transfer(value); delay(100); diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index 5206a09..1e37079 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -106,7 +106,7 @@ private: // slowest (128 == 2 ^^ 7, so clock_div = 6). uint8_t clockDiv; - // When the clock is known at compiletime, use this if-then-else + // When the clock is known at compile time, use this if-then-else // cascade, which the compiler knows how to completely optimize // away. When clock is not known, use a loop instead, which generates // shorter code. diff --git a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino index 61ce88c..061bb70 100644 --- a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino +++ b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino @@ -1,5 +1,5 @@ /* - Software serial multple serial test + Software serial multiple serial test Receives from the hardware serial, sends to software serial. Receives from software serial, sends to hardware serial. @@ -52,4 +52,3 @@ void loop() { // run over and over mySerial.write(Serial.read()); } } - diff --git a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino index 8d7f93e..d8c064b 100644 --- a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino +++ b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino @@ -1,5 +1,5 @@ /* - Software serial multple serial test + Software serial multiple serial test Receives from the two software serial ports, sends to the hardware serial port. @@ -56,7 +56,7 @@ void setup() { } void loop() { - // By default, the last intialized port is listening. + // By default, the last initialized port is listening. // when you want to listen on a port, explicitly select it: portOne.listen(); Serial.println("Data from port one:"); @@ -83,9 +83,3 @@ void loop() { // blank line to separate data from the two ports: Serial.println(); } - - - - - - diff --git a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino index 4d0a68f..aeb1a9c 100644 --- a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino +++ b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino @@ -3,7 +3,7 @@ // and James Tichenor // Demonstrates use of the Wire library reading data from the -// Devantech Utrasonic Rangers SFR08 and SFR10 +// Devantech Ultrasonic Rangers SFR08 and SFR10 // Created 29 April 2006 @@ -13,8 +13,8 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial communication at 9600bps + Wire.begin(); // join I2C bus (address optional for master) + Serial.begin(9600); // start serial communication at 9600 bps } int reading = 0; @@ -23,7 +23,7 @@ void loop() { // step 1: instruct sensor to read echoes Wire.beginTransmission(112); // transmit to device #112 (0x70) // the address specified in the datasheet is 224 (0xE0) - // but i2c adressing uses the high 7 bits so it's 112 + // but I2C addressing uses the high 7 bits so it's 112 Wire.write(byte(0x00)); // sets register pointer to the command register (0x00) Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50) // use 0x51 for centimeters diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino index dd40a25..b5da366 100644 --- a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino +++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) } byte val = 0; @@ -31,4 +31,3 @@ void loop() { } delay(500); } - diff --git a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino index 3febbf4..295edf7 100644 --- a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino +++ b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino @@ -5,7 +5,7 @@ // This program (or code that looks like it) // can be found in many places. // For example on the Arduino.cc forum. -// The original author is not know. +// The original author is not known. // Version 2, Juni 2012, Using Arduino 1.0.1 // Adapted to be as simple as possible by Arduino.cc user Krodal // Version 3, Feb 26 2013 @@ -33,7 +33,7 @@ void setup() { Wire.begin(); Serial.begin(9600); - while (!Serial); // Leonardo: wait for serial monitor + while (!Serial); // Leonardo: wait for Serial Monitor Serial.println("\nI2C Scanner"); } @@ -44,7 +44,7 @@ void loop() { for (byte address = 1; address < 127; ++address) { // The i2c_scanner uses the return value of - // the Write.endTransmisstion to see if + // the Wire.endTransmission to see if // a device did acknowledge to the address. Wire.beginTransmission(address); byte error = Wire.endTransmission(); diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino index ecab72a..e27cac3 100644 --- a/libraries/Wire/examples/master_reader/master_reader.ino +++ b/libraries/Wire/examples/master_reader/master_reader.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) Serial.begin(9600); // start serial for output } diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino index 5cbea11..7a17668 100644 --- a/libraries/Wire/examples/master_writer/master_writer.ino +++ b/libraries/Wire/examples/master_writer/master_writer.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) } byte x = 0; diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino index 8051d53..9b3f814 100644 --- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino +++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(8); // join i2c bus with address #8 + Wire.begin(8); // join I2C bus with address #8 Wire.onReceive(receiveEvent); // register event Serial.begin(9600); // start serial for output } diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino index d2e72bb..6e2ed49 100644 --- a/libraries/Wire/examples/slave_sender/slave_sender.ino +++ b/libraries/Wire/examples/slave_sender/slave_sender.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(8); // join i2c bus with address #8 + Wire.begin(8); // join I2C bus with address #8 Wire.onRequest(requestEvent); // register event } diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index c407776..001d924 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -100,7 +100,7 @@ void TwoWire::setClock(uint32_t clock) * when `clearWireTimeoutFlag()` or `setWireTimeoutUs()` is called. * * Note that this timeout can also trigger while waiting for clock stretching or waiting for a second master - * to complete its transaction. So make sure to adapt the timeout to accomodate for those cases if needed. + * to complete its transaction. So make sure to adapt the timeout to accommodate for those cases if needed. * A typical timeout would be 25ms (which is the maximum clock stretching allowed by the SMBus protocol), * but (much) shorter values will usually also work. * @@ -120,7 +120,7 @@ void TwoWire::setWireTimeout(uint32_t timeout, bool reset_with_timeout){ /*** * Returns the TWI timeout flag. * - * @return true if timeout has occured since the flag was last cleared. + * @return true if timeout has occurred since the flag was last cleared. */ bool TwoWire::getWireTimeoutFlag(void){ return(twi_manageTimeoutFlag(false)); diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index d223760..e09a33c 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -175,7 +175,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen } twi_state = TWI_MRX; twi_sendStop = sendStop; - // reset error state (0xFF.. no error occured) + // reset error state (0xFF.. no error occurred) twi_error = 0xFF; // initialize buffer iteration vars @@ -183,7 +183,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen twi_masterBufferLength = length-1; // This is not intuitive, read on... // On receive, the previously configured ACK/NACK setting is transmitted in // response to the received byte before the interrupt is signalled. - // Therefor we must actually set NACK when the _next_ to last byte is + // Therefore we must actually set NACK when the _next_ to last byte is // received, causing that NACK to be sent in response to receiving the last // expected byte of data. @@ -269,7 +269,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait } twi_state = TWI_MTX; twi_sendStop = sendStop; - // reset error state (0xFF.. no error occured) + // reset error state (0xFF.. no error occurred) twi_error = 0xFF; // initialize buffer iteration vars @@ -294,7 +294,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait // We need to remove ourselves from the repeated start state before we enable interrupts, // since the ISR is ASYNC, and we could get confused if we hit the ISR before cleaning // up. Also, don't enable the START interrupt. There may be one pending from the - // repeated start that we sent outselves, and that would really confuse things. + // repeated start that we sent ourselves, and that would really confuse things. twi_inRepStart = false; // remember, we're dealing with an ASYNC ISR startMicros = micros(); do { @@ -411,7 +411,7 @@ void twi_stop(void) // send stop condition TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO); - // wait for stop condition to be exectued on bus + // wait for stop condition to be executed on bus // TWINT is not set after a stop condition! // We cannot use micros() from an ISR, so approximate the timeout with cycle-counted delays const uint8_t us_per_loop = 8; -- cgit v1.2.3-18-g5258 From 65e63bf378488dabf79e377debd4b0fa05fb3316 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Mon, 18 Oct 2021 16:07:40 +0200 Subject: Inserted cast to unsigned int in available method in order to avoid call to __divmodhi4 --- libraries/SoftwareSerial/src/SoftwareSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries') diff --git a/libraries/SoftwareSerial/src/SoftwareSerial.cpp b/libraries/SoftwareSerial/src/SoftwareSerial.cpp index 3163d7a..5a387ab 100644 --- a/libraries/SoftwareSerial/src/SoftwareSerial.cpp +++ b/libraries/SoftwareSerial/src/SoftwareSerial.cpp @@ -409,7 +409,7 @@ int SoftwareSerial::available() if (!isListening()) return 0; - return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; + return ((unsigned int)(_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head)) % _SS_MAX_RX_BUFF; } size_t SoftwareSerial::write(uint8_t b) -- cgit v1.2.3-18-g5258