Converting interrupts from CPP to C

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

Hello Everyone,

 

I would like to convert a project from CPP format to C. I am having trouble dealing with interrupts.

The header in CPP file was #include <interrupt/interrupt_avr32.h> and I think it should be replaced by #include <avr/interrupt.h> in C.

do you know what are the equivalents of these functions in C:

CPP                                                   C

Disable_global_interrupt();            cli()

INTC_init_interrupts();                   ?

Enable_global_interrupt();             sei()

__interrupt__                                  ?

 

Any additional information or advice on converting from CPP to C is welcomed, this is my first time doing this and I have a lot to learn ;)

 

Thanks,

Adel

 

Adel Muhandes

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

None of the functions, headers or specifiers you listed have any special affinity to C or C++. They might be tied to a specific hardware platform, but they are not in any way tied to any specific language.

 

What made you believe that you have to replace that <interrupt/interrupt_avr32.h> with <avr/interrupt.h> in the first place?

Last Edited: Wed. May 15, 2019 - 04:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Adel Muhandes wrote:
The header in CPP file was #include <interrupt/interrupt_avr32.h>
Then this is a project for AVR32 not AVR8. In the tags of the first post you mention atmega32. Please specify whether it is ATmega32 (and 8 bit AVR8 micro) or AVR32 (a family of 32 bit micros) that you are working with.

Certainly anything that mentioned interrupt_avr32.h almost certainly has no use whatsoever for AVr micros such as ATmega32.

 

(and if you thought AVR32 == atmega32 then rest assured you are not the first to make such a mistake and post here about it! ;-)

 

You may want to say:

 

1) what is the CPP code you are trying to use? Link?

2) Is it really atmega32 you are developing with ?

Last Edited: Wed. May 15, 2019 - 03:09 PM