Skip to content

Commit 20a1e85

Browse files
committed
MD lint
1 parent 5a9fffa commit 20a1e85

8 files changed

Lines changed: 128 additions & 70 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ As promised, a bunch of additional information was released; Unfortunately it le
669669
## Warnings and Caveats
670670
There are however a few cautions warranted regarding megaTinyCore - either areas where the core is different from official cores, or where the behavior is the same, but not as well known.
671671

672-
### Linker sometimes fails on 8k parts due to an apparent compiler bug.
672+
### Linker sometimes fails on 8k parts due to an apparent compiler bug
673673
It doesn't seem to know it can wrap around with rjmp, and if would have to, it fails to link. This is only relevant on 8k parts. All I can advise is to not use those parts. Considering that 16k parts arent't much more expensive..
674674

675675

@@ -681,8 +681,8 @@ Therefore:
681681
* `takeOverTCxn()` has been called (`resumeTCxn()` to reverse this and reinitialize the timer to restore the functionality is available on DxCore, but I question the value of it and have not ported it).
682682
* If present, since resume reverses takeOver and reinitializes the timer for analogWrite PWM, you must not call it between when you called takeOver and when you write to register
683683
* You are changing only registers described in the relevant core documentation for that timer as being safe to modify without calling `takeOverTCxn()`.
684-
* The more complicated the timer, logically, the more likely it is that someone will be able to comprehend register manipulation relevant to their application without understanding the rest of the chapter (of datasheet) well enough to take full control as with a takeOver. In recognition of that (as well as the empirical observation that strange reconfiguration of the TCA is extremely common, as were questions about that prior to the introducution of relevant examples), we concluded that unlike the TCA, which is a well-behaved, very mundanetimer that is familiar, conceptually, to anyone who's useda classic AVR's TIMER1, the TCD is neither cooperative nor familiar, and few users are likely to be able to reconfigure it fully themselves, so while takeOverTCD0() is offered on partswith a TCD, we also put further effort into ensuring that as many options as possiblethat might plausibly be used with PWM could be altered while still using `analogWrite()`. These were documented in [the TCD reference](/megaavr/extras/Ref_TCD.md).
685-
* The much shorter list for TCA remains in the [timer reference](/egaavr/extras/Ref_Timers.md), as TCA has few relevant options not already controlled by analogWrite which are relevant when takeOverTCA0() is not called.
684+
* The more complicated the timer, logically, the more likely it is that someone will be able to comprehend register manipulation relevant to their application without understanding the rest of the chapter (of datasheet) well enough to take full control as with a takeOver. In recognition of that (as well as the empirical observation that strange reconfiguration of the TCA is extremely common, as were questions about that prior to the introducution of relevant examples), we concluded that unlike the TCA, which is a well-behaved, very mundanetimer that is familiar, conceptually, to anyone who's useda classic AVR's TIMER1, the TCD is neither cooperative nor familiar, and few users are likely to be able to reconfigure it fully themselves, so while takeOverTCD0() is offered on partswith a TCD, we also put further effort into ensuring that as many options as possiblethat might plausibly be used with PWM could be altered while still using `analogWrite()`. These were documented in [the TCD reference](megaavr/extras/Ref_TCD.md).
685+
* The much shorter list for TCA remains in the [timer reference](megaavr/extras/Ref_Timers.md), as TCA has few relevant options not already controlled by analogWrite which are relevant when takeOverTCA0() is not called.
686686
* You do not use any builtin functions that directly or indirectly call `analogWrite()`, `turnOffPWM()` or `digitalWrite()`
687687
* Reconfiguring the millis timer will break timekeeping very badly. If you need to reconfigure all the timers, such that you can't use the tools menu to put millis on a timer you don't need to reconfigure (ex, you need to use Servo and `tone()`, and reconfigure TCA for custom PWM on a tinyAVR 2), disable millis from the menu, whi
688688

megaavr/cores/megatinycore/wiring_analog.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,6 @@ void analogWrite(uint8_t pin, int val) {
11151115
return;
11161116
}
11171117
#if defined(TCD0) && defined(USE_TIMERD0_PWM) && defined(NO_GLITCH_TIMERD0)
1118-
11191118
uint8_t set_inven = 0;
11201119
#endif
11211120
// Set pin output because that's what Arduino does
@@ -1286,7 +1285,7 @@ void analogWrite(uint8_t pin, int val) {
12861285
/**********************************************************************
12871286
* PART 3.5: TIMERD noglitch
12881287
**********************************************************************/
1289-
#if defined(NO_GLITCH_TIMERD0) // This mode is always used with the stock variant.
1288+
#if defined(NO_GLITCH_TIMERD0) // This mode is no longer used by default, as it caused some other problems.
12901289
#if defined(USE_TCD_WOAB) && _AVR_PINCOUNT != 8
12911290
// TCD is on PA4 or PA5 on 14+ pin parts
12921291
if (set_inven == 0) { // we are not setting invert to make the pin HIGH when not set; either was 0 (just set CMPxSET > CMPBCLR) or somewhere in between.

0 commit comments

Comments
 (0)