delayMicroseconds does not rely on micros();
delayMicroseconds is a cycle counting busywait loop
Next release will make delay_microseconds a bit more accurate. I went over it and tweaked how it was organized.... but yeah rtc millis means no micros.
Even with millis disabled, however, delay() and delayMicrioseconds should stiill work.
delay loses is' normal trait of not being impacted by interrupts that fire durin the delay as long as they dont run for so long that millis drops time), but it works.
delay() without millis is implemented by - if the value passed to it is a constant, it just calles _delay_ms() from avrlibc. otherwise it calls _delay_ms(1) however mant times were specified.
delayMicroseconds() with a constant argument will use _delay_us (from avrlibc again), if the value is not constant it will instead use out implementation of it
Some of those changes may not yet be in board manager.
Once I port 3 features from DxCore and finish a 4th I'm going to make a beta version available for both cores through board manager because they need some testing before mainstream release.
There are kind of a lot of features...
* **New I2C/TWI implementation** (I2C and TWI refer to the same interface, the one provided by Wire.h; don't get me started about how these and the library are named).
* Support for acting as both master and slave (on the same pins); this configuration, sometimes known as "multi-master", includes not only the simple case of multiple masters and slaves on an I2C bus, each of which is always exclusively either a master or a slave, but also the more complicated case, which has been a frequent request: For the AVR device to act as both master AND slave. It can both initiate transactions with slaves, or respond to transactions initiated by other masters.
* New tools menu option to select whether to support only being a master *or* a slave, as we do now (default) or to support acting as both master *and* slave (new functionality).
* Support for Dual Mode (one instance of TWI acting as master on one pair of pins and slave on another) on parts that support it (there are no current or announced tinyAVR parts with dual mode support.
* Significantly reduced flash usage under all circumstances (even master+slave mode should use less flash than old master or slave mode - the cost of supporting master-and-slave mode is RAM for a second buffer. There is an implementation included that can use the same memory for both buffers, however, it is not currently exposed via an option due to the risk of breakage if you receive while preparing to send something.
* Failed attempts will timeout instead of hanging indefinitely.
* Support for slave counting the bytes read by the master, and for slave to check whether it's in the middle of a transaction (for example, before sleeping)
* Correct defect in the changelog (this file) due to a suspected a CEBCAK (cat exists between chair and keyboard).
* Recent change to C++17 required additions to new.cpp and new.h, including sized deallocation (`delete`) and alignment-aware `new` and `delete` operators. The sized deallocation operator is called when existing code that worked before is compiled to the C++ 17 standard; since free() doesn't care about the size, implementation was straightforward. Discussion is ongoing about the aligned `new` and `delete` operators, which are also new in this version of the standards. It is likely that we will not support them, since other Arduino cores aren't even building to C++ 17 standard, so if your code needs aligned new/delete, it also won't work anywhere else in Arduino-land. While we are not shy about adding features, we do so only to support hardware features. If conditions change we will revisit this matter.
* Using millis or micros (or rather attempting to) when they are unavailable due to millis being disabled, or in the case of micros, RTC used as millis time source, give better errors.
* Clarified licence (for one thing, renamed to a .md so people can read it more easily, and know that it's readable if they're on windows) for tinyNeoPixel.
* Improved docs for tinyNeoPixel. The two libraries each have a README.md linking to a greatly expanded library document.
* Document use of WDT for it's original purpose, to protect against hangs!
* Actually prevent disabling warnings - -Wall for all! You should not be compiling code with warnings disabled, the vast majority of the time, they're pointing to problems, and in the cases that aren't bugs, they're still a weak point that future bugs could come from (and that people will comment on when you post the code on forums to ask for help). I thought I'd done this a long time ago. Also pull in some warning-related flags from DxCore, including making implicit function declarations error, since the implied declarations when this happens are basically never result in working code, but it occasionally compiles and malfunctions.
* Fix timekeeping on clock speeds only supported with external clocks or tuning when a TCA or TCB is used for millis (it's still busted with the TCD)
* Correct SYSCFG0 fuse settings when burning bootloader for 2-series parts - they default the reserved bits to 1 not 0, and worse still, setting them to 0 enables a mode we probably don't want.
* Stop clearing fuse 4 by writing the default values for TCD0 on a 1-series. Now, with great difficulty, we only set that on parts that actually have the type D timer in order to keep our promise of burn bootloader restoring the chip to a fully known state. (well, except for the user row, and EEPROM if you've got it set to retain).
* Fix theoretical EEPROM.h bug inherited from avr-libc, and keep millis() from losing time when writing more than one byte at a time; update and harmonize with DxCore.
* Harmonize Comparator.h with DxCore.
* Fix 402 with bad signature support.
* Fix names of .lst and .map
* Add avrdude.conf for the 32k 2-series parts which are now becoming available.
* Fix bug with disabled millis on tinyNeoPixel libraries not working. Again.
* Correctly comment out leftover debugging prints that would be called when using `tone()` (megaTinyCore #550).
* Adjust serial buffer size 512b and 1k parts by adding an intermediate 32b serial buffer size.
* Parts with 512b are changed - from 16->32 for RX, TX unchanged at 16 (32->48 for each port used).
* Parts with 1k are changed - from 64 to 32 for TX, RX unchanged at 64 (128->96 for each port used).
* Smaller and larger parts are unchanged. This mostly helps to smooth out the RAM usage curve as you change flash size - going from 256 to 512 didn't previously change the allocation, while the jump from 512b to 1k was alarmingly large. The fact that the 8k 2-series have poirts each makes this more noticeable. This combined with another breakpoint led me to think that something else was broken.
* Officially deprecate jtag2updi.
* Port micros and delay-microseconds improvements from DxCore.
* Add a set of compatibility defines to make life easier for people porting non-Event library event-using code to 0/1-series.
* SerialUPDI reference now links to it's actual location.
* (TODO) - Port Serial changes here from DxCore
* (TODO) - Finish Event changes and port to here.
* (TODO) - Port enhanced documentation from DxCore.
* (TODO) - Port new attach interrupt from DxCore.
* (TODO) - Port new printf option from DxCore.
* Platform.txt organization and commenting. Fix issues where defines were missing from lib-discovery phase.
I'm not working on adding functionality RTC Millis because it will be made irrelevant by the sleep+powersave library
I'll note that micros is more accurate than 4ms with most combinations of settings. I only have a recent table availabe for DxCore though.
TCA: DxCore/Ref_Timers.md at master · SpenceKonde/DxCore · GitHub
TCB: DxCore/Ref_Timers.md at master · SpenceKonde/DxCore · GitHub
That's definitely true for megaTinyCore with the version of wiring.c in github, and I think it's the same for the last release