mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-20 14:54:31 +01:00
parent
0e7a434fe8
commit
f88c9847ac
@ -3,7 +3,9 @@ ARDUINO 1.0.5
|
|||||||
|
|
||||||
[core]
|
[core]
|
||||||
|
|
||||||
* malloc bug: backported avr-libc 1.8.0 implementation
|
* [avr] malloc bug: backported avr-libc 1.8.0 implementation
|
||||||
|
* [avr] removed deprecated interrupt handlers causing compiler issues
|
||||||
|
with newer avr-gcc.
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
|
@ -104,24 +104,16 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||||||
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
|
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
|
||||||
// do nothing - on the 32u4 the first USART is USART1
|
// do nothing - on the 32u4 the first USART is USART1
|
||||||
#else
|
#else
|
||||||
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
|
#if !defined(USART_RX_vect) && !defined(USART0_RX_vect)
|
||||||
!defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
|
|
||||||
!defined(SIG_UART_RECV)
|
|
||||||
#error "Don't know what the Data Received vector is called for the first UART"
|
#error "Don't know what the Data Received vector is called for the first UART"
|
||||||
#else
|
#else
|
||||||
void serialEvent() __attribute__((weak));
|
void serialEvent() __attribute__((weak));
|
||||||
void serialEvent() {}
|
void serialEvent() {}
|
||||||
#define serialEvent_implemented
|
#define serialEvent_implemented
|
||||||
#if defined(USART_RX_vect)
|
#if defined(USART_RX_vect)
|
||||||
SIGNAL(USART_RX_vect)
|
ISR(USART_RX_vect)
|
||||||
#elif defined(SIG_USART0_RECV)
|
|
||||||
SIGNAL(SIG_USART0_RECV)
|
|
||||||
#elif defined(SIG_UART0_RECV)
|
|
||||||
SIGNAL(SIG_UART0_RECV)
|
|
||||||
#elif defined(USART0_RX_vect)
|
#elif defined(USART0_RX_vect)
|
||||||
SIGNAL(USART0_RX_vect)
|
ISR(USART0_RX_vect)
|
||||||
#elif defined(SIG_UART_RECV)
|
|
||||||
SIGNAL(SIG_UART_RECV)
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if defined(UDR0)
|
#if defined(UDR0)
|
||||||
@ -149,7 +141,7 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||||||
void serialEvent1() __attribute__((weak));
|
void serialEvent1() __attribute__((weak));
|
||||||
void serialEvent1() {}
|
void serialEvent1() {}
|
||||||
#define serialEvent1_implemented
|
#define serialEvent1_implemented
|
||||||
SIGNAL(USART1_RX_vect)
|
ISR(USART1_RX_vect)
|
||||||
{
|
{
|
||||||
if (bit_is_clear(UCSR1A, UPE1)) {
|
if (bit_is_clear(UCSR1A, UPE1)) {
|
||||||
unsigned char c = UDR1;
|
unsigned char c = UDR1;
|
||||||
@ -158,15 +150,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||||||
unsigned char c = UDR1;
|
unsigned char c = UDR1;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#elif defined(SIG_USART1_RECV)
|
|
||||||
#error SIG_USART1_RECV
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USART2_RX_vect) && defined(UDR2)
|
#if defined(USART2_RX_vect) && defined(UDR2)
|
||||||
void serialEvent2() __attribute__((weak));
|
void serialEvent2() __attribute__((weak));
|
||||||
void serialEvent2() {}
|
void serialEvent2() {}
|
||||||
#define serialEvent2_implemented
|
#define serialEvent2_implemented
|
||||||
SIGNAL(USART2_RX_vect)
|
ISR(USART2_RX_vect)
|
||||||
{
|
{
|
||||||
if (bit_is_clear(UCSR2A, UPE2)) {
|
if (bit_is_clear(UCSR2A, UPE2)) {
|
||||||
unsigned char c = UDR2;
|
unsigned char c = UDR2;
|
||||||
@ -175,15 +165,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||||||
unsigned char c = UDR2;
|
unsigned char c = UDR2;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#elif defined(SIG_USART2_RECV)
|
|
||||||
#error SIG_USART2_RECV
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USART3_RX_vect) && defined(UDR3)
|
#if defined(USART3_RX_vect) && defined(UDR3)
|
||||||
void serialEvent3() __attribute__((weak));
|
void serialEvent3() __attribute__((weak));
|
||||||
void serialEvent3() {}
|
void serialEvent3() {}
|
||||||
#define serialEvent3_implemented
|
#define serialEvent3_implemented
|
||||||
SIGNAL(USART3_RX_vect)
|
ISR(USART3_RX_vect)
|
||||||
{
|
{
|
||||||
if (bit_is_clear(UCSR3A, UPE3)) {
|
if (bit_is_clear(UCSR3A, UPE3)) {
|
||||||
unsigned char c = UDR3;
|
unsigned char c = UDR3;
|
||||||
@ -192,8 +180,6 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
|
|||||||
unsigned char c = UDR3;
|
unsigned char c = UDR3;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#elif defined(SIG_USART3_RECV)
|
|
||||||
#error SIG_USART3_RECV
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void serialEventRun(void)
|
void serialEventRun(void)
|
||||||
|
@ -230,82 +230,82 @@ void attachInterruptTwi(void (*userFunc)(void) ) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(__AVR_ATmega32U4__)
|
#if defined(__AVR_ATmega32U4__)
|
||||||
SIGNAL(INT0_vect) {
|
ISR(INT0_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_0])
|
if(intFunc[EXTERNAL_INT_0])
|
||||||
intFunc[EXTERNAL_INT_0]();
|
intFunc[EXTERNAL_INT_0]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT1_vect) {
|
ISR(INT1_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_1])
|
if(intFunc[EXTERNAL_INT_1])
|
||||||
intFunc[EXTERNAL_INT_1]();
|
intFunc[EXTERNAL_INT_1]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT2_vect) {
|
ISR(INT2_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_2])
|
if(intFunc[EXTERNAL_INT_2])
|
||||||
intFunc[EXTERNAL_INT_2]();
|
intFunc[EXTERNAL_INT_2]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT3_vect) {
|
ISR(INT3_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_3])
|
if(intFunc[EXTERNAL_INT_3])
|
||||||
intFunc[EXTERNAL_INT_3]();
|
intFunc[EXTERNAL_INT_3]();
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(EICRA) && defined(EICRB)
|
#elif defined(EICRA) && defined(EICRB)
|
||||||
|
|
||||||
SIGNAL(INT0_vect) {
|
ISR(INT0_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_2])
|
if(intFunc[EXTERNAL_INT_2])
|
||||||
intFunc[EXTERNAL_INT_2]();
|
intFunc[EXTERNAL_INT_2]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT1_vect) {
|
ISR(INT1_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_3])
|
if(intFunc[EXTERNAL_INT_3])
|
||||||
intFunc[EXTERNAL_INT_3]();
|
intFunc[EXTERNAL_INT_3]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT2_vect) {
|
ISR(INT2_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_4])
|
if(intFunc[EXTERNAL_INT_4])
|
||||||
intFunc[EXTERNAL_INT_4]();
|
intFunc[EXTERNAL_INT_4]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT3_vect) {
|
ISR(INT3_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_5])
|
if(intFunc[EXTERNAL_INT_5])
|
||||||
intFunc[EXTERNAL_INT_5]();
|
intFunc[EXTERNAL_INT_5]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT4_vect) {
|
ISR(INT4_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_0])
|
if(intFunc[EXTERNAL_INT_0])
|
||||||
intFunc[EXTERNAL_INT_0]();
|
intFunc[EXTERNAL_INT_0]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT5_vect) {
|
ISR(INT5_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_1])
|
if(intFunc[EXTERNAL_INT_1])
|
||||||
intFunc[EXTERNAL_INT_1]();
|
intFunc[EXTERNAL_INT_1]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT6_vect) {
|
ISR(INT6_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_6])
|
if(intFunc[EXTERNAL_INT_6])
|
||||||
intFunc[EXTERNAL_INT_6]();
|
intFunc[EXTERNAL_INT_6]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT7_vect) {
|
ISR(INT7_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_7])
|
if(intFunc[EXTERNAL_INT_7])
|
||||||
intFunc[EXTERNAL_INT_7]();
|
intFunc[EXTERNAL_INT_7]();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
SIGNAL(INT0_vect) {
|
ISR(INT0_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_0])
|
if(intFunc[EXTERNAL_INT_0])
|
||||||
intFunc[EXTERNAL_INT_0]();
|
intFunc[EXTERNAL_INT_0]();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(INT1_vect) {
|
ISR(INT1_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_1])
|
if(intFunc[EXTERNAL_INT_1])
|
||||||
intFunc[EXTERNAL_INT_1]();
|
intFunc[EXTERNAL_INT_1]();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EICRA) && defined(ISC20)
|
#if defined(EICRA) && defined(ISC20)
|
||||||
SIGNAL(INT2_vect) {
|
ISR(INT2_vect) {
|
||||||
if(intFunc[EXTERNAL_INT_2])
|
if(intFunc[EXTERNAL_INT_2])
|
||||||
intFunc[EXTERNAL_INT_2]();
|
intFunc[EXTERNAL_INT_2]();
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ SIGNAL(INT2_vect) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SIGNAL(SIG_2WIRE_SERIAL) {
|
ISR(TWI_vect) {
|
||||||
if(twiIntFunc)
|
if(twiIntFunc)
|
||||||
twiIntFunc();
|
twiIntFunc();
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,9 @@ volatile unsigned long timer0_millis = 0;
|
|||||||
static unsigned char timer0_fract = 0;
|
static unsigned char timer0_fract = 0;
|
||||||
|
|
||||||
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
|
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
|
||||||
SIGNAL(TIM0_OVF_vect)
|
ISR(TIM0_OVF_vect)
|
||||||
#else
|
#else
|
||||||
SIGNAL(TIMER0_OVF_vect)
|
ISR(TIMER0_OVF_vect)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// copy these to local variables so they can be stored in registers
|
// copy these to local variables so they can be stored in registers
|
||||||
|
@ -100,28 +100,28 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
|
|||||||
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
|
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
|
||||||
// Interrupt handlers for Arduino
|
// Interrupt handlers for Arduino
|
||||||
#if defined(_useTimer1)
|
#if defined(_useTimer1)
|
||||||
SIGNAL (TIMER1_COMPA_vect)
|
ISR(TIMER1_COMPA_vect)
|
||||||
{
|
{
|
||||||
handle_interrupts(_timer1, &TCNT1, &OCR1A);
|
handle_interrupts(_timer1, &TCNT1, &OCR1A);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_useTimer3)
|
#if defined(_useTimer3)
|
||||||
SIGNAL (TIMER3_COMPA_vect)
|
ISR(TIMER3_COMPA_vect)
|
||||||
{
|
{
|
||||||
handle_interrupts(_timer3, &TCNT3, &OCR3A);
|
handle_interrupts(_timer3, &TCNT3, &OCR3A);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_useTimer4)
|
#if defined(_useTimer4)
|
||||||
SIGNAL (TIMER4_COMPA_vect)
|
ISR(TIMER4_COMPA_vect)
|
||||||
{
|
{
|
||||||
handle_interrupts(_timer4, &TCNT4, &OCR4A);
|
handle_interrupts(_timer4, &TCNT4, &OCR4A);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_useTimer5)
|
#if defined(_useTimer5)
|
||||||
SIGNAL (TIMER5_COMPA_vect)
|
ISR(TIMER5_COMPA_vect)
|
||||||
{
|
{
|
||||||
handle_interrupts(_timer5, &TCNT5, &OCR5A);
|
handle_interrupts(_timer5, &TCNT5, &OCR5A);
|
||||||
}
|
}
|
||||||
|
@ -360,7 +360,7 @@ void twi_releaseBus(void)
|
|||||||
twi_state = TWI_READY;
|
twi_state = TWI_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
SIGNAL(TWI_vect)
|
ISR(TWI_vect)
|
||||||
{
|
{
|
||||||
switch(TW_STATUS){
|
switch(TW_STATUS){
|
||||||
// All Master
|
// All Master
|
||||||
|
Loading…
x
Reference in New Issue
Block a user