From 448b46d9d3f2a4f203e453d08a9101a82d89da16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergi=20Hern=C3=A0ndez=20Juan?= <shernand@iri.upc.edu> Date: Thu, 21 Mar 2013 07:35:01 +0000 Subject: [PATCH] Updated the micro source code to change the name of the interrupt vectors to comply with the new compiler version. --- a2d.c | 2 +- i2c.c | 2 +- tibi_dabo_battery.c | 5 +++-- timer.c | 20 ++++++++++---------- uart.c | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/a2d.c b/a2d.c index 199c7b2..df980bc 100755 --- a/a2d.c +++ b/a2d.c @@ -107,7 +107,7 @@ u08 a2dIsComplete(void) } //! Interrupt handler for ADC complete interrupt. -SIGNAL(SIG_ADC) +SIGNAL(ADC_vect) { short int data; diff --git a/i2c.c b/i2c.c index 00a527e..b9f4236 100755 --- a/i2c.c +++ b/i2c.c @@ -356,7 +356,7 @@ void i2cMasterTransferNI(u08 deviceAddr, u08 sendlength, u08* senddata, u08 rece */ //! I2C (TWI) interrupt service routine -SIGNAL(SIG_2WIRE_SERIAL) +SIGNAL(TWI_vect) { // read status bits u08 status = inb(TWSR) & TWSR_STATUS_MASK; diff --git a/tibi_dabo_battery.c b/tibi_dabo_battery.c index 3cab20c..d2e7530 100755 --- a/tibi_dabo_battery.c +++ b/tibi_dabo_battery.c @@ -2,7 +2,6 @@ #include <avr/io.h> #include <avr/interrupt.h> #include <avr/sleep.h> -#include <util/delay.h> #include "uart.h" @@ -14,6 +13,8 @@ #include "i2c.h" +#include <util/delay.h> + typedef struct { unsigned char header[2]; @@ -73,7 +74,7 @@ int main (void) info.rem_capacity=get_remaining_capacity(); info.time_to_charged=get_time_to_charged(); info.time_to_discharged=get_time_to_discharged(); - // send tha information packet + // send the information packet for(i=0;i<sizeof(TBatteryInfo);i++) uartSendByte(((unsigned char *)&info)[i]); } diff --git a/timer.c b/timer.c index 434685b..33933d1 100755 --- a/timer.c +++ b/timer.c @@ -28,10 +28,10 @@ // Program ROM constants // the prescale division values stored in order of timer control register index // STOP, CLK, CLK/8, CLK/64, CLK/256, CLK/1024 -unsigned short __attribute__ ((progmem)) TimerPrescaleFactor[] = {0,1,8,64,256,1024}; +const unsigned short __attribute__ ((progmem)) TimerPrescaleFactor[] = {0,1,8,64,256,1024}; // the prescale division values stored in order of timer control register index // STOP, CLK, CLK/8, CLK/32, CLK/64, CLK/128, CLK/256, CLK/1024 -unsigned short __attribute__ ((progmem)) TimerRTCPrescaleFactor[] = {0,1,8,32,64,128,256,1024}; +const unsigned short __attribute__ ((progmem)) TimerRTCPrescaleFactor[] = {0,1,8,32,64,128,256,1024}; // Global variables // time registers @@ -392,7 +392,7 @@ void timer1PWMBSet(u16 pwmDuty) } //! Interrupt handler for tcnt0 overflow interrupt -TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW0) +TIMER_INTERRUPT_HANDLER(TIMER0_OVF_vect) { Timer0Reg0++; // increment low-order counter @@ -405,7 +405,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW0) } //! Interrupt handler for tcnt1 overflow interrupt -TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW1) +TIMER_INTERRUPT_HANDLER(TIMER1_OVF_vect) { // if a user function is defined, execute it if(TimerIntFunc[TIMER1OVERFLOW_INT]) @@ -414,7 +414,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW1) #ifdef TCNT2 // support timer2 only if it exists //! Interrupt handler for tcnt2 overflow interrupt -TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW2) +TIMER_INTERRUPT_HANDLER(TIMER2_OVF_vect) { Timer2Reg0++; // increment low-order counter @@ -427,7 +427,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OVERFLOW2) #ifdef OCR0 // include support for Output Compare 0 for new AVR processors that support it //! Interrupt handler for OutputCompare0 match (OC0) interrupt -TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE0) +TIMER_INTERRUPT_HANDLER(TIMER0_OVF_vect) { // if a user function is defined, execute it if(TimerIntFunc[TIMER0OUTCOMPARE_INT]) @@ -436,7 +436,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE0) #endif //! Interrupt handler for CutputCompare1A match (OC1A) interrupt -TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1A) +TIMER_INTERRUPT_HANDLER(TIMER1_COMPA_vect) { // if a user function is defined, execute it if(TimerIntFunc[TIMER1OUTCOMPAREA_INT]) @@ -444,7 +444,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1A) } //! Interrupt handler for OutputCompare1B match (OC1B) interrupt -TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1B) +TIMER_INTERRUPT_HANDLER(TIMER1_COMPB_vect) { // if a user function is defined, execute it if(TimerIntFunc[TIMER1OUTCOMPAREB_INT]) @@ -452,7 +452,7 @@ TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE1B) } //! Interrupt handler for InputCapture1 (IC1) interrupt -TIMER_INTERRUPT_HANDLER(SIG_INPUT_CAPTURE1) +TIMER_INTERRUPT_HANDLER(TIMER1_CAPT_vect ) { // if a user function is defined, execute it if(TimerIntFunc[TIMER1INPUTCAPTURE_INT]) @@ -460,7 +460,7 @@ TIMER_INTERRUPT_HANDLER(SIG_INPUT_CAPTURE1) } //! Interrupt handler for OutputCompare2 match (OC2) interrupt -TIMER_INTERRUPT_HANDLER(SIG_OUTPUT_COMPARE2) +TIMER_INTERRUPT_HANDLER(TIMER2_COMP_vect) { // if a user function is defined, execute it if(TimerIntFunc[TIMER2OUTCOMPARE_INT]) diff --git a/uart.c b/uart.c index 1209f63..3795f27 100755 --- a/uart.c +++ b/uart.c @@ -232,7 +232,7 @@ u08 uartSendBuffer(char *buffer, u16 nBytes) // UART Transmit Complete Interrupt Handler -UART_INTERRUPT_HANDLER(SIG_UART_TRANS) +UART_INTERRUPT_HANDLER(USART_TXC_vect) { // check if buffered tx is enabled /* if(uartBufferedTx) -- GitLab