diff --git a/README.md b/README.md index f5809821..a9728913 100644 --- a/README.md +++ b/README.md @@ -158,11 +158,11 @@ In versions prior to 2.0.0, this was instead configured using the Tools -> SPI P This core disables the SS pin when running in SPI master mode. This means that the "SS" pin can be used for whatever purpose you want - unlike classic AVRs, where this could not be disabled. Earlier versions of this document incorrectly stated that this behavior was enabled in megaTinyCore; it never was, and SS was always disabled. It should be re-enabled and the SS pin configured appropriately (probably as INPUT_PULLUP) if master/slave functionality is required. ### I2C (TWI) support -All of these parts have a single hardware I2C (TWI) peripheral. It works exactly like the one on official Arduino boards using the Wire.h library, except for the additional features noted below. See the pinout charts for the location of these pins. +All of these parts have a single hardware I2C (TWI) peripheral. It works exactly like the one on official Arduino boards using the Wire.h library, except for the additional features noted below. See the pinout charts for the location of these pins. You must be sure to use external pullup resistors on the SDA and SCL lines if the devices you are connecting do not have thos integrated (many Arduino/hobby targeted breakout boards do - typically 10k). The 30k-50k internal pullup resistors were never suitable for I2C pullup resistors - they were, in my opinion, the worst of both worlds; they often did work with the simple test case, leading the developer on their merry way thinking they were all set, only to discover that when they added another I2C device or two, or moved the device to the end of a longer cable, I2C suddenly no longer worked - it's probably better for it to fail immediately, prompting investigation and subsequent addition of appropriate pullup resistors. Note that there is nothing *preventing* one from enabling the internal pullups manually - you just should do so knowing that even if it happens to work, it's not a robust solution. On all parts with more than 8 pins, the TWI pins can be swapped to an alternate location. -On 2.0.0 and later, this is configured using the Wire.swap() or Wire.pins() methods. Both of them achieve the same thing, but differ in how you specify the set of pins to use. This should be called **before** Wire.begin(). This implementation of pin swapping is the same as what is used by +On 2.0.0 and later, this is configured using the Wire.swap() or Wire.pins() methods. Both of them achieve the same thing, but differ in how you specify the set of pins to use. This should be called **before** Wire.begin(). This implementation of pin swapping is the same as what is used by. `Wire.swap(1) or Wire.swap(0)` will set the the mapping to the alternate (1) or default (0) pins. It will return true if this is a valid option, and false if it is not (you don't need to check this, but it may be useful during development). If an invalid option is specified, it will be set to the default one. diff --git a/megaavr/cores/megatinycore/UART.h b/megaavr/cores/megatinycore/UART.h index 5d0e545c..1f7cdbe0 100644 --- a/megaavr/cores/megatinycore/UART.h +++ b/megaavr/cores/megatinycore/UART.h @@ -31,7 +31,7 @@ // using a ring buffer (I think), in which head is the index of the location // to which to write the next incoming character and tail is the index of the // location from which to read. -// NOTE: a "power of 2" buffer size is reccomended to dramatically +// NOTE: a "power of 2" buffer size is recommended to dramatically // optimize all the modulo operations for ring buffers. // WARNING: When buffer sizes are increased to > 256, the buffer index // variables are automatically increased in size, but the extra diff --git a/megaavr/cores/megatinycore/api/Common.cpp b/megaavr/cores/megatinycore/api/Common.cpp index d1f822c9..bd7a5e2d 100644 --- a/megaavr/cores/megatinycore/api/Common.cpp +++ b/megaavr/cores/megatinycore/api/Common.cpp @@ -7,4 +7,4 @@ long map(long x, long in_min, long in_max, long out_min, long out_max) } uint16_t makeWord(uint16_t w) { return w; } -uint16_t makeWord(uint8_t h, uint8_t l) { return (h << 8) | l; } \ No newline at end of file +uint16_t makeWord(uint8_t h, uint8_t l) { return (h << 8) | l; } diff --git a/megaavr/cores/megatinycore/api/PluggableUSB.h b/megaavr/cores/megatinycore/api/PluggableUSB.h index 09b5fed5..c289d903 100644 --- a/megaavr/cores/megatinycore/api/PluggableUSB.h +++ b/megaavr/cores/megatinycore/api/PluggableUSB.h @@ -72,4 +72,4 @@ class PluggableUSB_ { // https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use PluggableUSB_& PluggableUSB(); -#endif \ No newline at end of file +#endif diff --git a/megaavr/cores/megatinycore/wiring_analog.c b/megaavr/cores/megatinycore/wiring_analog.c index c389e847..f57ba969 100644 --- a/megaavr/cores/megatinycore/wiring_analog.c +++ b/megaavr/cores/megatinycore/wiring_analog.c @@ -208,7 +208,7 @@ void analogWrite(uint8_t pin, int val) cli(); _PROTECTED_WRITE(TCD0.FAULTCTRL,TCD0.FAULTCTRL|(1<<(6+bit_pos))); SREG=sreg; - TCD0.CTRLA=TIMERD0_PRESCALER|1; //reenable it + TCD0.CTRLA=TIMERD0_PRESCALER|1; //re-enable it } else { while(!(TCD0.STATUS&0x02)) {;} //if previous sync in progress, wait for it to finish. TCD0.CTRLE=0x02; //Synchronize diff --git a/megaavr/cores/megatinycore/wiring_digital.c b/megaavr/cores/megatinycore/wiring_digital.c index f4e50782..a8cbfb34 100644 --- a/megaavr/cores/megatinycore/wiring_digital.c +++ b/megaavr/cores/megatinycore/wiring_digital.c @@ -80,7 +80,7 @@ void pinMode(uint8_t pin, uint8_t mode) // // Mark Sproul: // - Removed inline. Save 170 bytes on atmega1280 -// - changed to a switch statment; added 32 bytes but much easier to read and maintain. +// - changed to a switch statement; added 32 bytes but much easier to read and maintain. // - Added more #ifdefs, now compiles for atmega645 // //static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline)); @@ -133,7 +133,7 @@ static void turnOffPWM(uint8_t pin) TCD0.CTRLA=0x10;//stop the timer while(!(TCD0.STATUS&0x01)) {;}// wait until it's actually stopped _PROTECTED_WRITE(TCD0.FAULTCTRL,TCD0.FAULTCTRL & ~(1<<(6+bit_pos))); - TCD0.CTRLA=0x11; //reenable it + TCD0.CTRLA=0x11; //re-enable it break; #endif default: diff --git a/megaavr/libraries/Logic/README.md b/megaavr/libraries/Logic/README.md index 3bf54f05..e85ae2e4 100644 --- a/megaavr/libraries/Logic/README.md +++ b/megaavr/libraries/Logic/README.md @@ -95,8 +95,8 @@ in::ac2; // Connect input to AC2 OUT (input 0, 1 only) Notes specific to ATtiny 0/1-series: * It is not clear what TCD0 WOAn is. I suspect it is true when TCD0 count is greater than TCD0.COMPSET0 and TCD0.CMPCLR0, ie, when WOA turns on and off, which can be individually controlled; the timer continues counting until reaching TCD0.CMPCLR1 when WOB turns off (TCD0 is a very strange timer). -* Not all inputs are available on all parts - only input sources corresponding to peripherals on that device are available. Not all options are avalable for input 2, as noted above. -* On CCL1 (logic1), IN0 I/O input is available only on the 20 and-24 pin parts, and IN1 and IN2 only on 24-pin parts. The event inputs can be used with pin events to take input from a diferent pins for up to two inputs. This is demonstrated in the five input example. +* Not all inputs are available on all parts - only input sources corresponding to peripherals on that device are available. Not all options are available for input 2, as noted above. +* On CCL1 (logic1), IN0 I/O input is available only on the 20 and-24 pin parts, and IN1 and IN2 only on 24-pin parts. The event inputs can be used with pin events to take input from a different pins for up to two inputs. This is demonstrated in the five input example. * CCL0's IN0 pin is on PA0, which is nominally the UPDI pin. This may limit the usefulness of CCL0 on the ATtiny parts (though it may work as long as the input cannot be mistaken for a UPDI activation command); configuring UPDI as GPIO prevents further programming via UPDI except via HV programming. One can always use the event system to substitute another input for IN0; This is demonstrated in the three input example. ##### Usage @@ -267,7 +267,7 @@ Logic::stop(); // Stop CCL ## attachInterrupt() Method for enabling interrupts for a specific block. Valid arguments for the third parameters are `RISING`, `FALLING` and `CHANGE`. -This method ins't available on tinyAVR 0/1-series, as these parts cannot generate an interrupt from the CCL blocks. +This method isn't available on tinyAVR 0/1-series, as these parts cannot generate an interrupt from the CCL blocks. ##### Usage ```c++ @@ -283,7 +283,7 @@ void blinkLED() ## detachInterrupt() Method for disabling interrupts for a specific block. -This method ins't available on tinyAVR 0/1-series. +This method isn't available on tinyAVR 0/1-series. ##### Usage ```c++ diff --git a/megaavr/libraries/Logic/src/Logic.cpp b/megaavr/libraries/Logic/src/Logic.cpp index 27f81ad8..262850ec 100644 --- a/megaavr/libraries/Logic/src/Logic.cpp +++ b/megaavr/libraries/Logic/src/Logic.cpp @@ -308,7 +308,7 @@ static const struct Logic::CCLBlock blocks[] = }, { // Note: 40-Pin version doesn't have output_alt, but the parts cannot - // be programatically distinguished - it's a 48-pin die in 40-pin package + // be programmatically distinguished - it's a 48-pin die in 40-pin package 1, PIN0_bm, PIN1_bm, PIN2_bm, PIN3_bm, PIN6_bm, PORTC, PORTC, PORTC, diff --git a/megaavr/libraries/SD/examples/CardInfo/CardInfo.ino b/megaavr/libraries/SD/examples/CardInfo/CardInfo.ino index 97913efd..ac17cae3 100644 --- a/megaavr/libraries/SD/examples/CardInfo/CardInfo.ino +++ b/megaavr/libraries/SD/examples/CardInfo/CardInfo.ino @@ -11,7 +11,7 @@ ** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila ** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila ** CS - depends on your SD card shield or module. - Pin 4 used here for consistency with other Arduino examples + Pin 4 used here for consistency with other Arduino examples created 28 Mar 2011 diff --git a/megaavr/libraries/SD/library.properties b/megaavr/libraries/SD/library.properties index 31c12db1..e07fdc32 100644 --- a/megaavr/libraries/SD/library.properties +++ b/megaavr/libraries/SD/library.properties @@ -2,7 +2,7 @@ name=SD version=1.2.4 author=Arduino, SparkFun maintainer=Arduino -sentence=Enables reading and writing on SD cards. +sentence=Enables reading and writing on SD cards. paragraph=Once an SD memory card is connected to the SPI interface of the Arduino or Genuino board you can create files and read/write on them. You can also move through directories on the SD card. category=Data Storage url=http://www.arduino.cc/en/Reference/SD diff --git a/megaavr/libraries/SD/src/SD.cpp b/megaavr/libraries/SD/src/SD.cpp index 8c9a29e7..64f79c37 100644 --- a/megaavr/libraries/SD/src/SD.cpp +++ b/megaavr/libraries/SD/src/SD.cpp @@ -280,7 +280,7 @@ namespace SDLib { /* boolean callback_openPath(SdFile& parentDir, char *filePathComponent, - boolean isLastComponent, void *object) { + boolean isLastComponent, void *object) { Callback used to open a file specified by a filepath that may specify one or more directories above it. diff --git a/megaavr/libraries/SD/src/utility/FatStructs.h b/megaavr/libraries/SD/src/utility/FatStructs.h index 8cb09809..426323a9 100644 --- a/megaavr/libraries/SD/src/utility/FatStructs.h +++ b/megaavr/libraries/SD/src/utility/FatStructs.h @@ -202,12 +202,12 @@ struct biosParmBlock { /** This field is only defined for FAT32 media and does not exist on FAT12 and FAT16 media. - Bits 0-3 -- Zero-based number of active FAT. + Bits 0-3 -- Zero-based number of active FAT. Only valid if mirroring is disabled. - Bits 4-6 -- Reserved. - Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs. - -- 1 means only one FAT is active; it is the one referenced in bits 0-3. - Bits 8-15 -- Reserved. + Bits 4-6 -- Reserved. + Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs. + -- 1 means only one FAT is active; it is the one referenced in bits 0-3. + Bits 8-15 -- Reserved. */ uint16_t fat32Flags; /**