Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f9e3f14

Browse files
committedMar 26, 2023
Fix a few more serious issues similar to #754
1 parent 535d7e0 commit f9e3f14

File tree

7 files changed

+47
-15
lines changed

7 files changed

+47
-15
lines changed
 

‎Bounties.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These will list the requirements for successfully claiming the bounty. The value
77

88
Additionally, two things not listed in issues are worth a bounty:
99
* A demonstration of how to use the avr_gcc function attribute "warning" to produce a warning if and only if a function declared with that attribute is **reachable** (this is supposed to work like #error, which generates an error only if the function declared with the error attribute is reachable after preprocessing, link time optimization, and constant folding. This is very different from the #warning directive, which generated a warning if it is present anywhere in the code after preprocessing. See badArg() and badCall() in Arduino.h and examples of how I use it in wiring_digital.c. I want the same thing for warnings.
10-
* An investigation of the ADC on the tragic ATtiny828, because I am dying of curiosity. See [my unsolved mysteries page on it](https://github.com/SpenceKonde/AVR_Research/blob/main/UnsolvedMysteries.md#the-828-and-the-mystery-of-the-adc) - in short, there is extremely strong evidence to suggest that there is a very fancy differential ADC that was planned for that part, and scrubbed at the last moment, with signs of a hasty editing of the datasheet to remove refeences to it. The register layout is identical to the Tiny841's layout, and it had a VERY fancy differential ADC. Based on the huge number of pins with analog inputs, it seems like the ADC was to be the crown jewel of the 828. My theory is that the window for release of the last classic tinyAVRs was closing, and it came back from the fab and the ADC was busted. The engineers asked for a respin, and management said "no", and so they released it was is. I speculate that they would not have released it at all if there was not *some* semblance of the differential ADC functionality there - that there was a workaround - but it was too complicated or too embarassing to describe in the errata; thus certain friendly customers (maybe ones involved in planning the part) know the trick to make the ADC run (or at least limp) in differential mode. I would love to close the book on this with either a conclusive proof that the unused mux options do nothing (A 27 level resistance ladder connected to every pin except the UART Tx pin, which can have it's ends swapped would be a good place to start - if you measure every unused option (use ADC_CH1, or information on the state of the ADC in production silicon.
10+
* An investigation of the ADC on the tragic ATtiny828, because I am dying of curiosity. See [my unsolved mysteries page on it](https://github.com/SpenceKonde/AVR_Research/blob/main/UnsolvedMysteries.md#the-828-and-the-mystery-of-the-adc) - in short, there is extremely strong evidence to suggest that there is a very fancy differential ADC that was planned for that part, and scrubbed at the last moment, with signs of a hasty editing of the datasheet to remove refeences to it. The register layout is identical to the Tiny841's layout, and it had a VERY fancy differential ADC. Based on the huge number of pins with analog inputs, it seems like the ADC was to be the crown jewel of the 828. My theory is that the window for release of the last classic tinyAVRs was closing, and it came back from the fab and the ADC was busted. The engineers asked for a respin, and management said "no", and so they released it was is. I speculate that they would not have released it at all if there was not *some* semblance of the differential ADC functionality there - that there was a workaround - but it was too complicated or too embarrassing to describe in the errata; thus certain friendly customers (maybe ones involved in planning the part) know the trick to make the ADC run (or at least limp) in differential mode. I would love to close the book on this with either a conclusive proof that the unused mux options do nothing (A 27 level resistance ladder connected to every pin except the UART Tx pin, which can have it's ends swapped would be a good place to start - if you measure every unused option (use ADC_CH1, or information on the state of the ADC in production silicon.
1111

1212
## All bounties will be in the form of free stuff from my Tindie store
1313
Free shipping via USPS first class mail is included for domestic bounty claimants. Due to the higher cost of international shipping, $8 will be debited from the value of the bounty if shipping internationally.

‎HowToHelp.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ While I can't promise anything beyond recognition for pull requests or other con
2222

2323
Two things are guaranteed to be worth a reward:
2424
* A demonstration of how to use the avr_gcc function attribute "warning" to produce a warning if and only if a function declared with that attribute is **reachable** (this is supposed to work like #error, which generates an error only if the function declared with the error attribute is reachable after preprocessing, link time optimization, and constant folding. This is very different from the #warning directive, which generated a warning if it is present anywhere in the code after preprocessing.
25-
* An investigation of the ADC on the tragic ATtiny828, because I am dying of curiosity. See [my unsolved mysteries page on it](https://github.com/SpenceKonde/AVR_Research/blob/main/UnsolvedMysteries.md#the-828-and-the-mystery-of-the-adc) - in short, there is extremely strong evidence to suggest that there is a very fancy differential ADC that was planned for that part, and scrubbed at the last moment, with signs of a hasty editing of the datasheet to remove refeences to it. The register layout is identical to the Tiny841's layout, and it had a VERY fancy differential ADC. Based on the huge number of pins with analog inputs, it seems like the ADC was to be the crown jewel of the 828. My theory is that the window for release of the last classic tinyAVRs was closing, and it came back from the fab and the ADC was busted. The engineers asked for a respin, and management said "no", and so they released it was is. I speculate that they would not have released it at all if there was not *some* semblance of the differential ADC functionality there - that there was a workaround - but it was too complicated or too embarassing to describe in the errata; thus certain friendly customers (maybe ones involved in planning the part) know the trick to make the ADC run (or at least limp) in differential mode. I would love to close thebook on this with either a conclusive proof that no functionality at all existed there, or information on the state of the ADC in production silicon.
25+
* An investigation of the ADC on the tragic ATtiny828, because I am dying of curiosity. See [my unsolved mysteries page on it](https://github.com/SpenceKonde/AVR_Research/blob/main/UnsolvedMysteries.md#the-828-and-the-mystery-of-the-adc) - in short, there is extremely strong evidence to suggest that there is a very fancy differential ADC that was planned for that part, and scrubbed at the last moment, with signs of a hasty editing of the datasheet to remove refeences to it. The register layout is identical to the Tiny841's layout, and it had a VERY fancy differential ADC. Based on the huge number of pins with analog inputs, it seems like the ADC was to be the crown jewel of the 828. My theory is that the window for release of the last classic tinyAVRs was closing, and it came back from the fab and the ADC was busted. The engineers asked for a respin, and management said "no", and so they released it was is. I speculate that they would not have released it at all if there was not *some* semblance of the differential ADC functionality there - that there was a workaround - but it was too complicated or too embarrassing to describe in the errata; thus certain friendly customers (maybe ones involved in planning the part) know the trick to make the ADC run (or at least limp) in differential mode. I would love to close thebook on this with either a conclusive proof that no functionality at all existed there, or information on the state of the ADC in production silicon.

‎avr/boards.txt

+26-2
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ attinyx8.menu.clock.extclk_3686k.build.clocksource=2
823823
################################
824824
attinyx8.menu.pinmap.default=Standard
825825
attinyx8.menu.pinmap.mhet=MH-ET Tiny
826-
attinyx8.menu.pinmap.mhet.build.variant=tinyx8_MH
826+
attinyx8.menu.pinmap.mhet.build.variant=tinyx8_mh
827827
attinyx8.menu.pinmap.default.build.pinmapabr=
828828
attinyx8.menu.pinmap.mhet.build.pinmapabr=.mhet
829829

@@ -5138,6 +5138,12 @@ attiny84mi12.menu.clock.internal_12m.build.f_cpu=12000000UL
51385138
attiny84mi12.menu.clock.internal_12m.build.speed=12m
51395139
attiny84mi12.menu.clock.internal_12m.build.clocksource=0
51405140
attiny84mi12.menu.clock.internal_12m.build.extra_flags=-DBOOT_TUNED120
5141+
attiny84mi12.menu.clock.internal_1m=1 MHz internal
5142+
attiny84mi12.menu.clock.internal_1m.bootloader.low_fuses=0x62
5143+
attiny84mi12.menu.clock.internal_1m.build.f_cpu=1000000UL
5144+
attiny84mi12.menu.clock.internal_1m.build.speed=1m
5145+
attiny84mi12.menu.clock.internal_1m.build.clocksource=0
5146+
attiny84mi12.menu.clock.internal_1m.build.extra_flags=-DBOOT_TUNED120
51415147

51425148
################################
51435149
# Pin Mapping menu #
@@ -5614,7 +5620,7 @@ attiny88micr.menu.clock.extclk_1m.build.clocksource=0x12
56145620
################################
56155621
attiny88micr.menu.pinmap.mhet=MH-Tiny
56165622
attiny88micr.menu.pinmap.default=Standard
5617-
attiny88micr.menu.pinmap.mhet.build.variant=tinyx8_mh
5623+
attiny88micr.menu.pinmap.mhet.build.variant=tinyx8_MH
56185624
attiny88micr.menu.pinmap.default.build.pinmapabr=
56195625
attiny88micr.menu.pinmap.mhet.build.pinmapabr=.mhet
56205626

@@ -6096,6 +6102,24 @@ attiny861micr.menu.remap.alternate.build.remap=-DSET_REMAPUSI
60966102
attiny861micr.menu.remap.default.build.remapabr=
60976103
attiny861micr.menu.remap.alternate.build.remapabr=rU
60986104

6105+
################################
6106+
# Software Serial menu #
6107+
################################
6108+
attiny861micr.menu.softserial861.enable_AIN1=RX on PA7, TX on PA (default PA6)
6109+
attiny861micr.menu.softserial861.enable_AIN0=RX on PA6, TX on PA (default PA7)
6110+
attiny861micr.menu.softserial861.enable_AIN0.build.softser=-DSOFTSERIAL_RXAIN0
6111+
attiny861micr.menu.softserial861.enable_AIN0.build.softserabr=ssAIN0
6112+
attiny861micr.menu.softserial861.enable_AIN2=RX on PA5, TX on PA (default PA6)
6113+
attiny861micr.menu.softserial861.enable_AIN2.build.softser=-DSOFTSERIAL_RXAIN2
6114+
attiny861micr.menu.softserial861.enable_AIN2.build.softserabr=ssAIN2
6115+
attiny861micr.menu.softserial861.txonly=No receiving, transmit only. TX on PA, default PA6.
6116+
attiny861micr.menu.softserial861.txonly.build.softserabr=ssTX
6117+
attiny861micr.menu.softserial861.txonly.build.softser=-DSOFT_TX_ONLY
6118+
attiny861micr.menu.softserial861.enable_AIN1.bootloader.uart=_rx7tx6
6119+
attiny861micr.menu.softserial861.enable_AIN0.bootloader.uart=_rx6tx7
6120+
attiny861micr.menu.softserial861.enable_AIN2.bootloader.uart=_rx5tx6
6121+
attiny861micr.menu.softserial861.txonly.bootloader.uart=_rx7tx6
6122+
60996123
################################
61006124
# BrownOut Detect menu #
61016125
################################

‎avr/extras/Ref_Wiring.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ These are the bare minimum requirements to bring the chip to life and program it
1919
* If a regulator is in use, an input capacitor should be installed as well. The requirements for this should be listed in the datasheet for the regulator - this varies from "0.1uF ceramic" to "10uF Tantalum or 47uF electrolytic"; take this specification seriously. This capacitor, if large enough, counts as board level decoupling for for V<sub>in</sub>.
2020
* The capacitor used for board level decoupling should be at an absolute bare minimum 1uF, and I would not recommend anything smaller than 4.7uF.
2121
* Any kind of cap is acceptable here, particularly for larger values.
22-
* Warning: Ceramic capacitors exhibit significant DC-bias dependance of capacitance. A 4.7uF 0402 capacitor might indeed be 4.7uF at 1V DC bias. At 5V, it will be 1-2uF only! See note below.
22+
* Warning: Ceramic capacitors exhibit significant DC-bias dependence of capacitance. A 4.7uF 0402 capacitor might indeed be 4.7uF at 1V DC bias. At 5V, it will be 1-2uF only! See note below.
2323
* For typical applications 4.7 or 10uf ceramic caps are acceptable (and by far the cheapest).
2424
* For especially long wires, or if large or fast changing loads are powered by the same supply, larger values should be used (preferably in parallel with a smaller ceramic).
2525
* Values as high as 1000uF may be needed if this is powered from the same supply as a long string of 2812 LEDs.
@@ -44,11 +44,11 @@ The second is that capacitance depends on the DC-bias (ie, applied DC voltage).
4444
Obviously, capacitor makers don't really like to talk about this - but they do have to tell people somewhere, so that angry customers can be pointed to some document or tool. Thus, you'll rarely see it in the excuse for a datasheet typically supplied for capacitors (this has very little information). Most capacitor companies will provide a tool on their website allowing you to get graphs of the C vs V<sub>DC bias</sub>, and in many cases search the manufacturer's products based on required capacitance at a specified DC bias. TDK (whose high capacitance ceramic caps are, for the most part, unusually good - though they are aware of this and their prices higher) and Murata (which seems to have fallen a bit behind the curve here) both provide nice tools for this (I like TDK's tool better). Samsung, another leader in the field (they're usually between Murata and TDK in this regard, and usually cheaper than both because of their incredible scale) has a mediocre tool on their website. Other large manufacturers likewise have such tools. Small manufacturers sometimes do NOT - if their capacitors are at risk of having relevant DC-bias effects, they should be avoided.
4545

4646
**What factors determine this?**
47-
There are 3 major factors: The nominal capacitance and the physical size (including the height - we care about physical volume) are major factors, and the table below is a good heuristic for knowing when this may be an issue. However, these are not the only factors - the manufacturing process for some companies is better than others, and it will vary with the temperature dependance code, and series of capacitors from a given company. This table below applies to capacitors with a temperature code starting with X (eg X7R). Note that while there are, as I said, differences between the different temperature codes, these are not strongly biased in either direction. The same company might sell X5R caps that are terrible with DC bias, and ones that are good, in the same package size and their X7R caps may be better or worse than them. So unless you know you're in safe territory, you've gotta look it up. Surprisingly, there is relatively little impact from the maximum rated voltage - you will often (on tools that let you superimpose several graphs) see the 25V part's curve exactly trace the curve of the 16V one, and just extend it longer.
47+
There are 3 major factors: The nominal capacitance and the physical size (including the height - we care about physical volume) are major factors, and the table below is a good heuristic for knowing when this may be an issue. However, these are not the only factors - the manufacturing process for some companies is better than others, and it will vary with the temperature dependence code, and series of capacitors from a given company. This table below applies to capacitors with a temperature code starting with X (eg X7R). Note that while there are, as I said, differences between the different temperature codes, these are not strongly biased in either direction. The same company might sell X5R caps that are terrible with DC bias, and ones that are good, in the same package size and their X7R caps may be better or worse than them. So unless you know you're in safe territory, you've gotta look it up. Surprisingly, there is relatively little impact from the maximum rated voltage - you will often (on tools that let you superimpose several graphs) see the 25V part's curve exactly trace the curve of the 16V one, and just extend it longer.
4848

4949
**Capacitor vs DC-Bias Risk Chart**
5050

51-
Columns are are the maximum size that you can confidently use without needing check the detailed specs, rows are the voltage that the part will be used at in opperation. At sizes 1 increment below the listed size, it is sometimes possible to find caps that retain a good deal of capacitance, but they are significanly outnumbered by ones that dont. . At the listed size, you'll usally be okay, but if you really care about the capacitance, you should check the graphs from the manufacturer. For large value capacitors, TDK usually wins. For smaller values TDK's advantage shrinks significantly. Thicker capacitors are usually better than thinner ones with the same footprint.
51+
Columns are are the maximum size that you can confidently use without needing check the detailed specs, rows are the voltage that the part will be used at in operation. At sizes 1 increment below the listed size, it is sometimes possible to find caps that retain a good deal of capacitance, but they are significantly outnumbered by ones that dont. . At the listed size, you'll usually be okay, but if you really care about the capacitance, you should check the graphs from the manufacturer. For large value capacitors, TDK usually wins. For smaller values TDK's advantage shrinks significantly. Thicker capacitors are usually better than thinner ones with the same footprint.
5252

5353
| Voltage | 0.1uF | 1.0uF | 4.7uF | 10 uF | 22 uF | 47 uF | 100 uF |
5454
|---------|-------|-------|-------|-------|-------|-------|--------|
@@ -59,15 +59,15 @@ Columns are are the maximum size that you can confidently use without needing ch
5959

6060
`*` - indicates that while parts of this size that are good up to that voltage are common, a non-negligible portion of them are not.
6161

62-
As you can see, as the voltage is increased, things rapidly get worse. This should not come as a great surprise. Charge is physical, and like anything, storing more of it takes more space (remember that a 1 Farad capacitor at 1 Volt stores 1 Coulomb of charge, while one at 5V stores 5 coulombs. If you've already packed a bunch of charge into a capacitor (like packing anything into any container), you'd expect that as it fills up, the same amount of voltage (or pressure for objects in containers) won't be able to force as much charge into it. This is also conceptually consistent with the formula for the stored *energy* in a capacitor, wich is proportional to the capacitance times the square of the voltage - Doubling the capacitance at a constant voltage is easier than doubling the voltage at a given capacitance.
62+
As you can see, as the voltage is increased, things rapidly get worse. This should not come as a great surprise. Charge is physical, and like anything, storing more of it takes more space (remember that a 1 Farad capacitor at 1 Volt stores 1 Coulomb of charge, while one at 5V stores 5 coulombs. If you've already packed a bunch of charge into a capacitor (like packing anything into any container), you'd expect that as it fills up, the same amount of voltage (or pressure for objects in containers) won't be able to force as much charge into it. This is also conceptually consistent with the formula for the stored *energy* in a capacitor, which is proportional to the capacitance times the square of the voltage - Doubling the capacitance at a constant voltage is easier than doubling the voltage at a given capacitance.
6363

6464
Sizes of ceramic caps above 1210 are often quite expensive - they lose their price advantage over tantalum caps. They are also not viewed favorably by many engineers, because of a perception that they are prone to failure due to board flex leading to cracking. Peer reviewed studies have debated how serious of an issue this is. People try to avoid using large capacitors. It is often morecommon to see several lower value 1206 or 1210 caps in parallel (this is very common on DC-DC converters, for example, where the input voltage might range to 25v. They might then put a pair of 22uF 1206 or 1210 caps; these might be good for a regulator that needed a minimum of 4.7uF or 10uF of input capacitance (respectively). )
6565

6666

6767
#### Tantalum caps involve ethical concerns?
68-
Uh, yeah, they do. tantalum is predominantly mined in southern and central Africa - a land of great mineral wealth, and considerable human suffering. The ore, known colloquially as "Coltan" is considered a conflict mineral. Some is mined ethically. Some is mined by children or at gunpoint. Some of the otherwise legitimately mined ore is stolen by organized crime rings. When prices have spiked, it has been economically viable to *fly heavyass ore out of the rural areas in helicopters*. The illegally produced material is sold to fund various militias, while proceeds from the legally produced stuff are often skimmed off by the kleptocrats running those nations; whether a militia, organized crime ring, or kleptocrat ends up with the money, it will likely be used to fund the endless civil wars that continue to immiserate the populations of those countries. So tantalum caps, while they offer stable capacitance over a wide voltage range, and they have a size advantage at highcapacitance (starting around 100uF, lower for higher voltage caps), have an an ethical shadow cast over them. And they occasionally "explode" though this concern has been largely solved since their introduction, and "explode" is a very dramatic way of putting it. They'll definitely smoke, and occasionally briefly ignite (though all I could get is smoke when I was intentionally trying to see one of those "exploding capacitors").
68+
Uh, yeah, they do. tantalum is predominantly mined in southern and central Africa - a land of great mineral wealth, and considerable human suffering. The or, known colloquially as "Coltan" is considered a conflict mineral. Some is mined ethically. Some is mined by children or at gunpoint. Some of the otherwise legitimately mined or is stolen by organized crime rings. When prices have spiked, it has been economically viable to *fly heavyass or out of the rural areas in helicopters*. The illegally produced material is sold to fund various militias, while proceeds from the legally produced stuff are often skimmed off by the kleptocrats running those nations; whether a militia, organized crime ring, or kleptocrat ends up with the money, it will likely be used to fund the endless civil wars that continue to immiserate the populations of those countries. So tantalum caps, while they offer stable capacitance over a wide voltage range, and they have a size advantage at highcapacitance (starting around 100uF, lower for higher voltage caps), have an an ethical shadow cast over them. And they occasionally "explode" though this concern has been largely solved since their introduction, and "explode" is a very dramatic way of putting it. They'll definitely smoke, and occasionally briefly ignite (though all I could get is smoke when I was intentionally trying to see one of those "exploding capacitors").
6969

70-
Of course, a non-negligible portion of gold on the international market (used for your ENIG surface treatment, and some bond wires in ICs) comes from "wildcat" or "artisanal" gold mining, which often involves improperly disposing of mercury and cyanide compounds and contaminates drinking water in third world nations, but ENIG is the de-facto standard if you want to go lead free; leaded solder in discarded electronics leaches lead in landfills, leading to groundwater contamination in your country, which is why many countries have banned its use. If you look at the raw materials or end of life disposal of most products - even mundane things like food, clothing, and so on, it's hard to find one without some kind of ethical concern or another, and it's often difficult to be sure that whatever you got was sourced ethically.
70+
Of course, a non-negligible portion of gold on the international market (used for your ENIG surface treatment, and some bond wires in ICs) comes from "wildcat" or "artisanal" gold mining, which often involves improperly disposing of mercury and cyanide compounds and contaminates drinking water in third world nations, but ENIG is the de-facto standard if you want to go lead free; lead solder in discarded electronics leaches lead in landfills, leading to groundwater contamination in your country, which is why many countries have banned its use. If you look at the raw materials or end of life disposal of most products - even mundane things like food, clothing, and so on, it's hard to find one without some kind of ethical concern or another, and it's often difficult to be sure that whatever you got was sourced ethically.
7171

7272

7373
### Additional requirements for programming over Serial using Optiboot:

‎avr/extras/development/create_boards_txt.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,13 @@ def getspeed(string,speed):
10141014
".menu.clock.internal_12m.build.f_cpu=12000000UL",
10151015
".menu.clock.internal_12m.build.speed=12m",
10161016
".menu.clock.internal_12m.build.clocksource=0",
1017-
".menu.clock.internal_12m.build.extra_flags=-DBOOT_TUNED120"],
1017+
".menu.clock.internal_12m.build.extra_flags=-DBOOT_TUNED120",
1018+
".menu.clock.internal_1m=1 MHz internal",
1019+
".menu.clock.internal_1m.bootloader.low_fuses=0x62",
1020+
".menu.clock.internal_1m.build.f_cpu=1000000UL",
1021+
".menu.clock.internal_1m.build.speed=1m",
1022+
".menu.clock.internal_1m.build.clocksource=0",
1023+
".menu.clock.internal_1m.build.extra_flags=-DBOOT_TUNED120"],
10181024
"hasvoltdependance":False,
10191025
"defaultvariant":"tinyx4_cw",
10201026
"lfuse_ext":"0xE0",
@@ -1416,7 +1422,7 @@ def getspeed(string,speed):
14161422
".menu.usbpins.prototype.bootloader.usbpinset=-DLED_BUILTIN=PIN_PB6",
14171423
".menu.usbpins.prototype.bootloader.usbpinsetname=_proto",
14181424
".menu.usbpins.prototype.upload.maximum_size=6460"],
1419-
"softser":False,
1425+
"softser":True,
14201426
"fancysoftser":True,
14211427
"hfuse":"0b{bootloader.rstbit}1011{bootloader.bod_bits}",
14221428
"efuse":"0xFE",

‎avr/variants/tinyx5/pins_arduino.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,10 @@ static const uint8_t A3 = ADC_CH(3);
7777
// #define DEFAULT_INITIALIZE_ADC 1
7878
// #define DEFAULT_INITIALIZE_SECONDARY_TIMERS 1
7979

80-
// We have hardware serial, so don't use soft serial.
81-
// #define USE_SOFTWARE_SERIAL 0
80+
/* Builtin Software Serial "Serial"
81+
* TX is on AIN0, RX is on AIN1. Comparator interrupt used so PCINTs remain
82+
* available for other uses. Comparator pins in Analog section below. */
83+
#define USE_SOFTWARE_SERIAL 1
8284

8385
/*---------------------------------------------------------------------------
8486
* Chip Features - Timers amnd PWM

‎avr/variants/tinyx7_digi/pins_arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static const uint8_t A15 = ADC_CH(8);
8989
#define digitalPinToPCICRbit(p) (((p) >= 5 && (p) <= 12) ? PCIE0 : PCIE1 )
9090
#define digitalPinToPCMSK(p) (((p) >= 5 && (p) <= 12) ? (&PCMSK0) : (&PCMSK1) )
9191

92-
#define digitalPinToPCMSKbit(p) ((((p) >= 0) && ((p) <= 2)) ? (p) : ((((p) >= (6)) && ((p) <= (13))) ? ((p) - (6)) : (((p) > (13)) ? ((p) - (10)) : (((p) == 3) ? (6) : (((p) == 4) ? (3) : (7))))) /* pin 5 */
92+
#define digitalPinToPCMSKbit(p) ((((p) >= 0) && ((p) <= 2)) ? (p) : ((((p) >= (6)) && ((p) <= (13))) ? ((p) - (6)) : (((p) > (13)) ? ((p) - (10)) : (((p) == 3) ? (6) : (((p) == 4) ? (3) : (7)))))) /* pin 5 */
9393

9494

9595
#define digitalPinToInterrupt(p) (((p) == PIN_PB6) ? 0 : (((p) == PIN_PA3) ? 1 : NOT_AN_INTERRUPT))

0 commit comments

Comments
 (0)
Please sign in to comment.