ISR with no attributes

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Introduces an interrupt handler function (interrupt service routine) that runs with global interrupts initially disabled by default with no attributes specified."

For example, when I use:

ISR(TIMER1_COMPB_vect)

and I look at the .lss for the ISR code, I would expect the first instruction to be 'cli' but thats not the case. In fact, it does not disable inteerupts anywhere in the ISR code. Am I missing something? Does it occur elsewhere before the jumping to the ISR? If so, where, I cant seem to find it. Thanks in advance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need NO_BLOCK or NOBLOCK or similar, read the avr-libc docs for the exact name.

But beware, avr-libc uses attributes "signal" and "interrupt" at the same time. It had never been documented what that should mean. The respective GCC extension is PR53256 added in 4.7.1.

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yep, but I actually want the ISR to be blocking (global interrupts are disbaled on ISR entry), which is supposed to be the dafault, but its not happening in the generated code. I can manually add it, or use ISR_BLOCK, but I kinda wanted some explaination of why the global ints are not disabled, or where that code is taking place.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

and I look at the .lss for the ISR code, I would expect the first instruction to be 'cli' but thats not the case.

Why would you expect a CLI when by definition interrupts are already disabled when an ISR is entered? Pull out your AVR datasheet and find the "Reset and Interrupt Handling" section...
Quote:
When an interrupt occurs, the Global Interrupt Enable I-bit is cleared and all interrupts are disabled. The user software can write logic one to the I-bit to enable nested interrupts. All enabled interrupts can then interrupt the current interrupt routine. The I-bit is automatically set when a Return from Interrupt instruction – RETI – is executed.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yep, thats why. Ok, thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

got so pre-occupied staring at the software, i forgot about the hardware =) thanks again

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When an interrupt occurs, global interrupt is automatically disabled by hardware so the ISR doesn't need to disable it again using CLI instruction.