2.6.1 - What 2.6.0 was supposed to be
Okay, so 2.6.0 didn't work out very well. Hopefully this will work better, but the debacle brought down CI testing, which needs to be able to install the last release, so there may very well be problems that it would have caught, had 2.6.0 not been an unmitigated disaster.
The big Bugfix/enhancements from 2.6.0/2.6.1 are:
- Serious issues in Event for tinyAVR 0/1-series parts have been corrected, and the logic and comparator libraries can now (by not touching ComparatorN.attachInterrupt(), manually define an interrupt with attachInterrupt. The same goes for Logic (though with the CCL , all the LUTs share one ISR).
- Bugs relating to waking from sleep modes other than idle (which is the "why am I bopther with this" sleep mode that barely saves any power) while acting as TWI slave have been fixed and it now wakes reliably from all sleep modes, including TWI address match (which is one of few privileged things that can wake from power down sleep mode]
- A pair of enhancements to serial from completely different angles have been added:
- Thanks to the work of @MX682X we have been able to take yet another piece of the disastrous Arduino API out behind the woodshed to get what it deserves. By reworking the class hierarchy, we have slashed the number of flash wasting virtual member functions, which the compiler is required to generate even when they are never called. The savings is on the order of around 500 bytes. That's not going to excite people working with 32k parts, but we absolutely do have users on 2k and 4k parts for whom 500 bytes is a great blessing.
- That is in spite of my adding functionality to Serial: getStatus(), autobaud support see the [serial reference] (https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/Ref_Serial.md) and should now automatically dodge the SFDEN errata so you should be able to wake on that.
Full list of changes:
- 2.6.0 Bugfix: Correct several USART bugs that snuck through, including an apparent regression that would prevent proper serial operation.
- 2.6.0 Bugfix: Azduino5 was no good. Same filesystem structure error as usual, moved to Azduino6.
- 2.6.0 Bugfix: The 4000 lines of workarounds for compatibility issues introduced by the toolchain update didn't make it into the megaTinyCore release.
- 2.6.0 Bugfix: The platform.txt file had been trashed by a bungled merge and tried to upload based on params that didn't exist.
- 2.6.0 Bugfix: Correct an include path that confused some alternative IDEs.
- 2.6.0 Bugfix: Correct compile error involving RS485 USART configuration.
- 2.6.0 Bugfix: Comparator library namespace error fixed. (thanks @ObviousInRetrospect)
- 2.6.0 Bugfix: Advertised 2 MHz internal option was not actually available in non-tuned configurations. Prior to 2.6.0 there was no intent to support this.
- Enhancement: millis with a type B timer is over 25% faster, and uses 30% less flash for the ISR. (thanks @MX683X)
- Bugfix: Correct a few anomalies in boards.txt.
2.6.0
- You can now enable and disable the ADC with analogPowerOption() and enable/disable standby mode.
- Bugfix: Fix issue with SSD bit being cleared when using beginTransaction().
- Bugfix: Fix bug in Logic with pin inputs being handled improperly.
- Bugfix: Remove multiple signatures for Wire.requestFrom to fix issues with Wire with certain libraries.
- Bugfix: Correct tuning, particularly to speeds below 16 MHz. Boards should be re-tuned if 14 MHz-derived speed is to be used
- Bugfix: Correct default option for Optiboot 2-series boards with 20 pins to be the one with alt reset.
- Bugfix:
long_soft_event
method did not work correctly. - Bugfix: Removed attempted optimization by inlining analogReadEnh; I had wrongly assumed that it would then not inline the call to
_analogReadEnh
. Well, it wound up inlining it, with the result being exactly what I had hoped to prevent. I don't think this made it into a release. - Bugfix: Event was not functioning correctly on tinyAVR parts.
- Bugfix: Correct bug(s) when waking from sleep mode via TWI (aka I2C/Wire) address match (Thanks @MX682X. You are one of our MVPs). TWI slaves should now reliably wake on address match and other wake sources from all sleep modes.
- Bugfix: 3224 optiboot maximum upload size was same as 1624. Oops.
- Bugfix: Microchip boards in optiboot mode (admittedly a rare mode) were not subtracting the size of the bootloader from the chip capacity.
- Enhancement: Lay groundwork in Event library for the new event system changes in the EA-series (There will be 2 generators per port, and 2 for RTC - but all of these will be accessible by all event channels, and a register on the peripheral controls which of the options is used for these two channels). While inapplicable to tinyAVR, Event.h and Event.cpp distributed with DxCore and megaTinyCore is identical.
- Bugfix: Fix compatibility of Comparator, Event, and Logic.
- Workaround: mysterious issues with detecting the major version that prevented manual installation ever since 1.8.14. I kept hoping that the next version would fix it, but, no such luck. It still impacted used on 1.8.19 and likely future versions as well.
- Major enhancement: Change class hierarchy for UARTs, as was done for Two_Wire (Wire.h), so that rather than pulling in api/HardwareSerial.h, and subclassing that definition of HardwareSerial (itself a subclass of Stream) as UartClass, we instead simply subclass Stream directly. UART.h will be renamed to HardwareSerial.h, HardwareSerial.h (a compatibility layer) will be renamed to UART.h and the latter adjusted to #define UartClass as HardwareSerial, and api/HardwareSerial.h will be gutted and simply #include <HardwareSerial.h> This will remove yet another piece of the disastrous "ArduinoAPI". I describe it as such because on low resource platforms like AVR; this will allow several functions currently declared virtual to lose that keyword, as the linker, even with LTO enabled, is not permitted to remove unused virtual functions. This reduces binary size when using serial significantly, despite significant new features. Credit goes to @MX624X.
- Enhancement: Split up the Event and Logic library headers for improved readability.
- Enhancement: RTC millis does not interfere with waking on RTC compare match. (PR #793)
- Enhancement: great deal of harmonization with DxCore.
- Enhancement: Improvement to stream timed read to make it work when millis is disabled, and to save 4 bytes of RAM. Note that this also requires all offsets used to access the Serial transmit and receive buffers to be reduced accordingly in the inline assembly in UART.cpp.
- New Feature: Now you can use ADC1 just like it was an ADC0, see the notes in Analog Input (ADC) and output (DAC) for steps required to enable it. This does not use space if not enabled.
- New Feature: Add new functions to assist checking error codes in analogRead results.
- New Feature: Permit Logic and Comparator ISRs to be defined manually if (and only if!) the
.attachInterrupt()
method of an instance of that class is not called. You can then manually create the ISR saving about 40 bytes and 50 clock cycles, give or take. - New Feature: megaTinyCore.h now provides functions to reset chip via WDT timeout and via software reset. If optiboot is used, the former will not run it, while the latter will.
- New Feature: Add option for serial autobaud use, record cumulative errors USART has encountered and provide method to view and clear them.
- New Feature: Support SFD to wake on USART. User is otherwise responsible to configuring this and should be aware that in order to be able to receive the characters, we turn it off after receiving a character.
- Docs: made clear om PowerSave.md that the ADC must be disabled to get low standbby current.
- Docs: Add link to my article on AVR math speed (TLDR: avoid
int64_t
long long
like the plague) - Docs: Fix many documentation issues, improve docs generally.
- Docs: Expand documentation significantly, and document the new serial features.
- Unenhancement: Remove getAnalogSampleDuration(), as I could not make anything compile with that in and had worked on it over a day.
- Enhancement: 2 MHz is now a supported clock speed.