Skip to content

Commit 8192b9d

Browse files
committed
minor compile failures
1 parent db5aee5 commit 8192b9d

4 files changed

Lines changed: 23 additions & 15 deletions

File tree

megaavr/cores/megatinycore/core_devices.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,39 +1013,39 @@ has once worked for the same thing as meaning that thing */
10131013
#define TCA_SINGLE_EVACT_UPDOWN_gc TCA_SINGLE_EVACTA_UPDOWN_gc
10141014
#endif
10151015
// Some versions of the EA headers have it as PORTx_EVGENCTRL, retroactively changed to PORTx_EVGENCTRLA, implying plans for more.
1016-
#if defined(PORTA_EVGENCTRL)
1016+
#if defined(PORTA_EVGENCTRL)
10171017
#define PORTA_EVGENCTRLA PORTA_EVGENCTRL
1018-
#else
1018+
#elif defined(PORTA_EVGENCTRLA)
10191019
#define PORTA_EVGENCTRL PORTA_EVGENCTRLA
10201020
#endif
10211021
#if defined(PORTB_EVGENCTRL)
10221022
#define PORTB_EVGENCTRLA PORTB_EVGENCTRL
1023-
#else
1023+
#elif defined(PORTB_EVGENCTRLA)
10241024
#define PORTB_EVGENCTRL PORTB_EVGENCTRLA
10251025
#endif
10261026
#if defined(PORTC_EVGENCTRL)
10271027
#define PORTC_EVGENCTRLA PORTC_EVGENCTRL
1028-
#else
1028+
#elif defined(PORTC_EVGENCTRLA)
10291029
#define PORTC_EVGENCTRL PORTC_EVGENCTRLA
10301030
#endif
10311031
#if defined(PORTD_EVGENCTRL)
10321032
#define PORTD_EVGENCTRLA PORTD_EVGENCTRL
1033-
#else
1033+
#elif defined(PORTD_EVGENCTRLA)
10341034
#define PORTD_EVGENCTRL PORTD_EVGENCTRLA
10351035
#endif
10361036
#if defined(PORTE_EVGENCTRL)
10371037
#define PORTE_EVGENCTRLA PORTE_EVGENCTRL
1038-
#else
1038+
#elif defined(PORTE_EVGENCTRLA)
10391039
#define PORTE_EVGENCTRL PORTE_EVGENCTRLA
10401040
#endif
10411041
#if defined(PORTF_EVGENCTRL)
10421042
#define PORTF_EVGENCTRLA PORTF_EVGENCTRL
1043-
#else
1043+
#elif defined(PORTF_EVGENCTRLA)
10441044
#define PORTF_EVGENCTRL PORTF_EVGENCTRLA
10451045
#endif
10461046
#if defined(PORTG_EVGENCTRL)
10471047
#define PORTG_EVGENCTRLA PORTG_EVGENCTRL
1048-
#else
1048+
#elif defined(PORTG_EVGENCTRLA)
10491049
#define PORTG_EVGENCTRL PORTG_EVGENCTRLA
10501050
#endif
10511051

megaavr/libraries/Comparator/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ comparator::in_p::in0; // Use positive input pin 0 as input
6060
comparator::in_p::in1; // Use positive input pin 1 as input (if present)
6161
comparator::in_p::in2; // Use positive input pin 2 as input (if present)
6262
comparator::in_p::in3; // Use positive input pin 3 as input (if present)
63+
comparator::in_p::in4; // Use positive input pin 4 as input (if present, DD and later omly)
64+
comparator::in_p::in5; // Use positive input pin 5 as input (if present, EB and later only)
65+
comparator::in_p::in5; // Use positive input pin 6 as input (if present, EB and later only)
6366
```
6467

6568
#### Usage
@@ -77,10 +80,13 @@ Accepted values:
7780
``` c++
7881
comparator::in_n::in0; // Use negative input pin 0 as input
7982
comparator::in_n::in1; // Use negative input pin 1 as input (if present)
80-
comparator::in_n::in2; // Use negative input pin 2 as input (2-series only)
81-
comparator::in_n::vref; // Use the voltage reference w/out DAC (0/1-series only)
82-
comparator::in_n::dacref; // Use DACREF as input (1/2-series only)
83+
comparator::in_n::in2; // Use negative input pin 2 as input (if present, 2-series and Dx/Ex only)
84+
comparator::in_n::in3; // Use negative input pin 3 as input (DD and later only)
85+
comparator::in_n::vref; // Use the voltage reference w/out DAC (0/1-series only.
86+
comparator::in_n::dacref; // Use DACREF as input - not available on megaAVR 0-series. Available on all other devices. On tiny1
8387
```
88+
#### What is the DACREF?
89+
On the tinyAVR 1-series, a new feature was added to the AC's (okay, it was a new feature that they dropped on the 0-series, since the 1-series came out first) - the 1-series had a DAC, so they let you use the output of that as the negative input, without having to output it on a pin! Of course, when they packed all those extra peripherals onto the larger tiny1's to test things out for the Dx, that was awkward, since they now had 3 comparators to model the window comparator feature going in the DA/DB. They only had one full fledged DAC. And they sure weren't going to put 3 full DACs on the DA/DB nor one DAC (normally only found on higher end parts) per comparator (at least one is found on every or nearly every AVR that has ever been made). So on the 1+-series parts, they just gave them kneecapped DACs with no pin output, except for the first one, which was unchanged from the other 1-series. That was fine for the 1-series, but it wasn't great.
8490

8591
#### Usage
8692
``` c++

megaavr/libraries/Event/src/Event.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ Event& Event::get_generator_channel(uint8_t generator_pin)
197197
uint8_t gen = 0xFF;
198198
if (port != NOT_A_PIN && port_pin != NOT_A_PIN) {
199199
#if defined(PORTA_EVGENCTRL)
200-
volatile port_t* port_ptr = portToPortStruct(port);
200+
#error "what the f?"
201+
volatile PORT_t* port_ptr = portToPortStruct(port);
201202
uint8_t temp = port_ptr.EVGENCTRL;
202-
if ((temp & 0x0F == port_pin) {
203+
if ((temp & 0x0F) == port_pin) {
203204
gen = 0x40 + (port << 1);
204205
_SWAP(port_pin);
205-
} else if ((temp & 0xF0 == port_pin)) {
206+
} else if ((temp & 0xF0) == port_pin) {
206207
gen = 0x40 + (port << 1) + 1;
207208
}
208209
if (gen == 0xFF)

megaavr/libraries/Logic/src/Logic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,5 @@ void Logic::init() {
138138
| (enable ? CCL_ENABLE_bm : 0 );
139139
}
140140

141-
/* Generally speaking, in code that is executed often or which isspeed sensitive, you prefer to avoid shift operations where one or both of the operands is not compile time known.
141+
/* Generally speaking, in code that is executed often or which isspeed sensitive, you prefer to avoid shift operations where one or both of the operands is not compile time known.*/
142+

0 commit comments

Comments
 (0)