From 5123918765ab2e27670e9fe3277e3e3f676d9bb8 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 6 Mar 2013 17:35:12 -0500 Subject: [PATCH 1/2] Add A0, A1, A2, A3 constants and analogPinToChannel(). --- attiny/variants/tiny8/pins_arduino.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/attiny/variants/tiny8/pins_arduino.h b/attiny/variants/tiny8/pins_arduino.h index 7e77900..e64b887 100755 --- a/attiny/variants/tiny8/pins_arduino.h +++ b/attiny/variants/tiny8/pins_arduino.h @@ -39,11 +39,18 @@ // GND 4| |5 PB0 (D 0) pwm0 // +----+ +static const uint8_t A0 = 6; +static const uint8_t A1 = 7; +static const uint8_t A2 = 8; +static const uint8_t A3 = 9; + #define digitalPinToPCICR(p) ( ((p) >= 0 && (p) <= 4) ? (&GIMSK) : ((uint8_t *)0) ) #define digitalPinToPCICRbit(p) ( PCIE ) #define digitalPinToPCMSK(p) ( ((p) <= 4) ? (&PCMSK) : ((uint8_t *)0) ) #define digitalPinToPCMSKbit(p) ( (p) ) +#define analogPinToChannel(p) ( (p) < 6 ? (p) : (p) - 6 ) + #ifdef ARDUINO_MAIN // these arrays map port names (e.g. port B) to the @@ -74,6 +81,10 @@ const uint8_t PROGMEM digital_pin_to_port_PGM[] = { PB, PB, PB, // 5 + PB, // A0 + PB, + PB, + PB, // A4 }; @@ -84,7 +95,10 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { _BV(3), /* 3 port B */ _BV(4), _BV(5), - + _BV(5), + _BV(2), + _BV(4), + _BV(3), }; const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { @@ -94,6 +108,10 @@ const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, }; #endif From fde77b8b73baaa9cd7a4fe30f9484e9cb9f32f6a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Sat, 14 Sep 2013 11:57:43 +0200 Subject: [PATCH 2/2] Fixed tool definition. --- attiny/avr/boards.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/attiny/avr/boards.txt b/attiny/avr/boards.txt index 6445599..e48e9e0 100644 --- a/attiny/avr/boards.txt +++ b/attiny/avr/boards.txt @@ -7,6 +7,7 @@ attiny.bootloader.unlock_bits=0xff attiny.bootloader.lock_bits=0xff attiny.build.core=arduino:arduino attiny.build.board=attiny +attiny.upload.tool=arduino:avrdude attiny.menu.cpu.attiny45=ATtiny45 attiny.menu.cpu.attiny45.upload.maximum_size=4096