is a macro provided by one of the files included by <xc.h>,
supposedly to make it easier,
by not having to manipulate the parantheses of the __attribute__((...)) construct.
It should end up the same anyway after preprocessing
'micromips' is the instruction set used by the CPU in PIC32MM devices.
It is a version of MIPS32 instruction set with 16 bit instruction word size.
In some other PIC32 devices, there may be possible to switch between 32 bit instructions and 16 bit instructions,
but as far as I understand, PIC32MM devices use 16 bit instrucctions only.
Specifying micromips, in the interrupt specification, might be redundant.
The compiler will probably use the 16 bit instruction set anyway if it know that it shall run on a MM.
It does no harm, confirming that code is intended for a PIC32MM. void__ISR(_ADC1Interrupt, IPL7SOFT) ADC1Interrupt(void);with a semicolon at the end, is just a declaration, it will not produce executable code for a interrupt handler, so it cannot be resolved by the linker. You must provide a body for the interrupt handler, without the semicolon :void __attribute__ ((vector(_ADC_VECTOR), interrupt(IPL7SOFT), micromips)) _ADC1Interrupt(void)
IFS0CLR = _IFS0_AD1IF_MASK; /* Clear the interrupt flag. */
/* ... Insert interrupt handling code. */
} Writing Declarations for interrupt handlers, is not really needed on PIC32. There are no other functions that shall be able , or allowed to call the Interrupt Service Routine. Compiler and linker will know how to make the ISR code, and know where it shall be placed, from the definition and body of the interrupt handler. And if there is an interrupt Enabled, and it trigger, interrupt hardware will go to the interrupt vector location, whether you have prepared a ISR or not. If there is no ISR written, then default_interrupt_handler will be called, and that one will Reset the microcontroller.
There may be some new constructs available with XC32 compilers version 2.xx
Look up XC32 Compiler Users Guide, it is on your computer in a \docs directory,
together with compiler binaries, and all the include files and other stuff.
Look for: __interrupt(...) Mysil
post edited by Mysil - 2019/12/05 20:29:33