Skip to content

Commit 2ba92ad

Browse files
committed
Fix minor issue in varants
1 parent 7a5ae81 commit 2ba92ad

3 files changed

Lines changed: 24 additions & 19 deletions

File tree

megaavr/variants/32pin-standard/pins_arduino.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,22 @@ Include guard and include basic libraries. We are normally including this inside
7474
# # # # # # # #
7575
#### # # #### ### ### #*/
7676

77+
#define NUM_DIGITAL_PINS (27)
78+
#define NUM_ANALOG_INPUTS (12)
7779

78-
#define PINS_COUNT 27
79-
#define NUM_DIGITAL_PINS PINS_COUNT
80-
#define NUM_ANALOG_INPUTS 12
81-
#define NUM_RESERVED_PINS 0
82-
#define NUM_INTERNALLY_USED_PINS 0
83-
#define NUM_I2C_PINS 4 // (SDA / SCL)
84-
#define NUM_SPI_PINS 6 // (MISO / MOSI / SCK)
80+
#define PINS_COUNT NUM_DIGITAL_PINS
81+
//#define NUM_RESERVED_PINS 0
82+
//#define NUM_INTERNALLY_USED_PINS 0
8583
#define NUM_TOTAL_FREE_PINS (NUM_DIGITAL_PINS)
8684
#define NUM_TOTAL_PINS (NUM_DIGITAL_PINS)
8785

86+
// Here we can override the default pin for the LED with a command line option or something opassed through boards.txt or platform.txt.
8887
#if !defined(LED_BUILTIN)
89-
#define LED_BUILTIN PIN_PA7
88+
#define LED_BUILTIN (PIN_PA7)
9089
#endif
9190
/* Until the legacy attach interrupt has been completely obsoleted */
9291
#ifdef CORE_ATTACH_OLD
93-
#define EXTERNAL_NUM_INTERRUPTS 47
92+
#define EXTERNAL_NUM_INTERRUPTS (47)
9493
#endif
9594

9695
/* # ### ### #### ### ###
@@ -267,7 +266,7 @@ static const uint8_t A21 = PIN_A21;
267266

268267
#ifdef ARDUINO_MAIN
269268
/* this guards against multiple definition errors, since this file gets included by everything,
270-
but only in one case should these tables be generated */
269+
* but only in one case should these tables be generated */
271270
const uint8_t digital_pin_to_port[] = {
272271
PA, // 0 PA0/XTAL0/CLKIN
273272
PA, // 1 PA1/XTAL1

megaavr/variants/48pin-standard/pins_arduino.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Include guard and include basic libraries. We are normally including this inside
7979
# # # # # # # #
8080
#### # # #### ### ### #*/
8181

82-
#define PINS_COUNT 41 // Last pin number +1
83-
#define NUM_ANALOG_INPUTS 18
82+
#define PINS_COUNT (41) // Last pin number +1
83+
#define NUM_ANALOG_INPUTS (18)
8484
// #define NUM_RESERVED_PINS 0 // These may at your option be defined,
8585
// #define NUM_INTERNALLY_USED_PINS 0 // They will be filled in with defaults otherwise
8686
// Autocalculated are :
@@ -89,14 +89,19 @@ Include guard and include basic libraries. We are normally including this inside
8989
// Count of I2C and SPI pins will be defined as 2 and 3 but not used in further calculations. If you
9090
// for some reason need to change this, define them here. Only ones not defined here get automatically set.
9191

92+
#define PINS_COUNT NUM_DIGITAL_PINS
93+
//#define NUM_RESERVED_PINS 0
94+
//#define NUM_INTERNALLY_USED_PINS 0
95+
#define NUM_TOTAL_FREE_PINS (NUM_DIGITAL_PINS)
96+
#define NUM_TOTAL_PINS (NUM_DIGITAL_PINS)
9297

9398
// Here we can override the default pin for the LED with a command line option or something opassed through boards.txt or platform.txt.
9499
#if !defined(LED_BUILTIN)
95-
#define LED_BUILTIN PIN_PA7
100+
#define LED_BUILTIN (PIN_PA7)
96101
#endif
97102
/* Until the legacy attach interrupt has been completely obsoleted */
98103
#ifdef CORE_ATTACH_OLD
99-
#define EXTERNAL_NUM_INTERRUPTS 47
104+
#define EXTERNAL_NUM_INTERRUPTS (47)
100105
#endif
101106

102107
/* # ### ### #### ### ###

megaavr/variants/64pin-standard/pins_arduino.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,20 @@ Include guard and include basic libraries. We are normally including this inside
103103
// for some reason need to change this, define them here. Only ones not defined here get automatically set.
104104

105105

106-
// Here we can override the default pin for the LED with a command line option or something opassed through boards.txt or platform.txt.
106+
#define PINS_COUNT NUM_DIGITAL_PINS
107+
//#define NUM_RESERVED_PINS 0
108+
//#define NUM_INTERNALLY_USED_PINS 0
109+
#define NUM_TOTAL_FREE_PINS (NUM_DIGITAL_PINS)
110+
#define NUM_TOTAL_PINS (NUM_DIGITAL_PINS)
107111

108112
#if !defined(LED_BUILTIN)
109-
#define LED_BUILTIN PIN_PA7
113+
#define LED_BUILTIN (PIN_PA7)
110114
#endif
111-
112115
/* Until the legacy attach interrupt has been completely obsoleted */
113116
#ifdef CORE_ATTACH_OLD
114117
#define EXTERNAL_NUM_INTERRUPTS (56)
115118
#endif
116119

117-
118120
/* # ### ### #### ### ###
119121
## ## # # # # # # # #
120122
# # # ##### # #### # # ###
@@ -386,7 +388,6 @@ static const uint8_t A21 = PIN_A21;
386388
#define AIN20 ADC_CH(20)
387389
#define AIN21 ADC_CH(21)
388390

389-
390391
/*## ### # # ### #### #### ### # # ###
391392
# # # ## # # # # # # # # # # # #
392393
#### # # # # ##### #### #### ##### # ###

0 commit comments

Comments
 (0)