Society of Robots - Robot Forum

Software => Software => Topic started by: Silver_79 on July 30, 2009, 10:15:35 AM

Title: AVR Studios, its about time
Post by: Silver_79 on July 30, 2009, 10:15:35 AM
Hi all, OK I finally got through the ARV tutorial for the Axon and it built without crashing Vista. There was however one error when it completed that I have listed below:


Warning-timer640.c:355: warning: 'BAD_vect' appears to be a misspelled signal

Will this be a problem when I upload to the robot ? Will it run as intended ? Or is my robot going to try to kill my cat ? :P
Title: Re: AVR Studios, its about time
Post by: sonictj on July 30, 2009, 10:48:02 AM
I'd be willing to bet it should be BADISR_vect .
Title: Re: AVR Studios, its about time
Post by: wil.hamilton on July 30, 2009, 10:56:06 AM
just google the warning and see if the results are similar for things like what you're trying to do
Title: Re: AVR Studios, its about time
Post by: Admin on August 03, 2009, 02:34:27 PM
I honestly don't know what that warning is, but it hasn't caused me any problems yet! :P

It'll only give you that warning when you do a rebuild-all.
Title: Re: AVR Studios, its about time
Post by: sonictj on August 05, 2009, 12:45:25 AM
quote from avrlibc
Quote
Catch-all interrupt vector

If an unexpected interrupt occurs (interrupt is enabled and no handler is installed, which usually indicates a bug), then the default action is to reset the device by jumping to the reset vector. You can override this by supplying a function named BADISR_vect which should be defined with ISR() as such. (The name BADISR_vect is actually an alias for __vector_default. The latter must be used inside assembly code in case <avr/interrupt.h> is not included.)

#include <avr/interrupt.h>

ISR(BADISR_vect)
{
    // user code here
}


I checked the code it should be BADISR_vect, BAD_vect is not an interrupt vector.

The moral of the story is you won't have any problems unless you enable an interrupt without the proper ISR vector.  The BADISR_vect will catch a bat interrupt call.  Unless you write interrupt code you won't notice any problems.  Thats why everything still works ;D.
Title: Re: AVR Studios, its about time
Post by: Admin on August 05, 2009, 07:47:55 AM
good investigative work! I just tried it, and the prob went away.

I'll fix the BADISR_vect issue tonight and upload the corrected code as v1.09.


For now, just open up timer640.c, go to the very bottom of the page, and change BAD_vect to BADISR_vect.