Skip to content

Commit

Permalink
Style/spelling fixes
Browse files Browse the repository at this point in the history
Also gets the manual release of 2.1.2 ahead of the board manager one
  • Loading branch information
SpenceKonde committed Oct 12, 2020
1 parent e0d9367 commit 2be0ae7
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/UART.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/api/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
uint16_t makeWord(uint8_t h, uint8_t l) { return (h << 8) | l; }
2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/api/PluggableUSB.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ class PluggableUSB_ {
// https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
PluggableUSB_& PluggableUSB();

#endif
#endif
2 changes: 1 addition & 1 deletion megaavr/cores/megatinycore/wiring_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions megaavr/cores/megatinycore/wiring_digital.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions megaavr/libraries/Logic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++
Expand All @@ -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++
Expand Down
2 changes: 1 addition & 1 deletion megaavr/libraries/Logic/src/Logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion megaavr/libraries/SD/examples/CardInfo/CardInfo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion megaavr/libraries/SD/library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name=SD
version=1.2.4
author=Arduino, SparkFun
maintainer=Arduino <[email protected]>
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
Expand Down
2 changes: 1 addition & 1 deletion megaavr/libraries/SD/src/SD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions megaavr/libraries/SD/src/utility/FatStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down

0 comments on commit 2be0ae7

Please sign in to comment.