You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* IS_MVIO_ENABLED() may *or may not* be a compile time known constant!
67
+
* This depends on the tools menu option selected for MVIO, and whether we can assume that the code is running on a properly configured part.
68
+
* That is a safe assumption when we build for direct upload, since users will upload the code via UPDI and we can set the fuse then.
69
+
* When using a bootloader, we have no such guarantee - we can't set the fuses when we upload, so unless the user tells us that they
70
+
* really are sure it's configured right, we will test whether MVIO is enabled.
71
+
* In any event, PD2 is only present on parts with the nearly complete PORTD. */
72
+
#if _AVR_PINCOUNT > 28
73
+
#definePORTDPIN0 PORTD.PIN0CTRL
74
+
#definePORTDPIN2 PORTD.PIN2CTRL
75
+
#definePORTDPIN3 PORTD.PIN3CTRL
76
+
#else
77
+
#definePORTDPIN0 AC_NULL_REG
78
+
#definePORTDPIN2 AC_NULL_REG
79
+
#definePORTDPIN3 AC_NULL_REG
80
+
#endif
81
+
#if defined(AC0_AC_vect)
82
+
AnalogComparator Comparator0(0, AC0, PORTDPIN2, /* No PORTE, so none of these*/ PORTD.PIN6CTRL, PORTC.PIN3CTRL,/* No INP5, nor INP6 on DUs */ PORTDPIN3, PORTDPIN0, PORTD.PIN7CTRL);
#elif defined(ANALOG_COMP_PINS_DU) /*Exactly like the DU, except there's no PC2 on any of them hence no INN3 but the 28/32 pin versions have PD0 unlike the DD's so they have that input. */
253
+
AnalogComparator(constuint8_t comparator_number,
254
+
AC_t& ac,
255
+
register8_t& in0_p,
256
+
register8_t& in3_p,
257
+
register8_t& in4_p,
258
+
register8_t& in0_n,
259
+
register8_t& in1_n,
260
+
register8_t& in2_n);
249
261
#elif defined(ANALOG_COMP_PINS_EA) /*9 inputs - with 48 pins EA gets all inputs for at least one comparator. P0, P1, P2, P3, P4, N0, N1, N2, N3 */
0 commit comments