chipKIT® Development Platform

Inspired by Arduino™

plib.h gives expected unqualified-id before numeric constant

Created Sun, 23 Mar 2014 18:40:01 +0000 by TechnoX


TechnoX

Sun, 23 Mar 2014 18:40:01 +0000

I want to turn off interrupts in some very small critical parts of my code. I thought INTEnable() was the way to go, as this works in MPLAB. But here in MPIDE I get a lot of errors.

I use this code to demonstrate the problem (my real code is a lot bigger with classes and others, but this regenerates the error):

#include <ChangeNotification.h>
#include <plib.h>

int inputPin = 3;
boolean enabled = true;
uint32_t UpdatePeriod = 500 * CORE_TICK_RATE;

void setup()
{
    Serial.begin(9600);
    pinMode(inputPin, INPUT_PULLUP);
    attachCoreTimerService(Controller);
}

void loop()
{
    if(!enabled && digitalRead(inputPin))
    {
        Serial.println("--Enable interrupt");
        // enable the core timer interrupt
        INTEnable(INT_CT, INT_ENABLED);
        enabled = true;
    }else if(enabled && !digitalRead(inputPin))
    {
        Serial.println("--Disable interrupt");
        // disable the core timer interrupt
        INTEnable(INT_CT, INT_DISABLED);
        enabled = false;
    }
   
    Serial.println(millis());
    delayMicroseconds(638300);
    
}



uint32_t Controller(uint32_t currentTime){
 Serial.println("Inside interrupt!"); 
 return currentTime + UpdatePeriod;
}

The ChangeNotification.h is a library which I downloaded to be able to trigger interrupts on both falling and rising edge. Read more about the library here: http://sourceforge.net/projects/chipkitcn/

I have read this thread http://chipkit.net/forum/viewtopic.php?f=6&t=367 which seems to treat about the same problem, but there Mark wrote that this has been fixed and pushed to the github repository. Maybe there are some other error now?

This is the errors I receive (with the installation path shortened to [mpide_folder]):

In file included from [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:50:0, from [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/plib.h:54, from TestInterrupt.cpp:2: [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:342:33: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:360:5: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:363:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:364:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:365:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:366:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:367:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:368:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:369:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:370:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:377:5: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:380:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:381:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:385:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:386:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:387:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:388:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:389:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:390:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:391:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:392:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:393:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:394:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:395:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:396:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:397:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:398:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:399:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:400:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:408:5: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:416:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:417:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:418:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:419:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:428:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:429:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:430:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:431:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:432:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:433:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:434:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:435:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:436:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:437:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:438:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:439:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:440:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:441:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:442:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:443:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:444:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:445:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:446:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:447:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:448:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:449:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:450:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:451:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:452:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:453:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:454:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:455:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:456:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:457:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:458:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:459:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:470:5: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:485:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:486:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:487:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:488:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:489:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:490:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:491:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:492:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:493:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:494:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:495:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:496:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:497:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:498:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:499:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:500:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:501:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:502:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:503:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:504:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:505:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:506:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:507:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:508:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:509:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:510:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:511:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:512:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:513:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:514:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:515:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:516:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:517:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:518:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:519:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:520:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:521:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:522:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:523:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:524:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:525:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:526:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:527:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:528:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:529:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:530:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:531:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:532:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:533:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:534:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:535:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:536:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:537:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:538:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:539:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:540:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:541:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:542:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:543:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:544:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:545:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:546:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:547:21: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/GenericTypeDefs.h:548:21: error: expected unqualified-id before numeric constant In file included from [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/plib.h:54:0, from TestInterrupt.cpp:2: [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:158:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:161:9: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:1082:41: error: expected identifier before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:1082:41: error: expected ',' or '...' before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/i2c.h:1331:1: error: expected unqualified-id before numeric constant In file included from [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/plib.h:69:0, from TestInterrupt.cpp:2: [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:833:86: error: expected identifier before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:833:86: error: expected ',' or '...' before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h: In function 'void UARTSendDataByte(UART_MODULE, int)': [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:835:27: error: 'data' was not declared in this scope [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h: At global scope: [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:997:15: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:1083:39: error: expected identifier before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/uart.h:1083:39: error: expected ',' or '...' before numeric constant In file included from [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/plib.h:72:0, from TestInterrupt.cpp:2: [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/CAN.h:868:3: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/CAN.h:932:3: error: expected unqualified-id before numeric constant [mpide_folder]\hardware\pic32\compiler\pic32-tools\bin../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/peripheral/CAN.h:937:5: error: expected unqualified-id before numeric constant

Thanks in advance!


majenko

Sun, 23 Mar 2014 19:04:49 +0000

MPIDE and plib.h don't play well together (there's a huge long thread about it on here if you take the time to look).

To disable interrupts all you need do is:

disableInterrupts();
// your code
enableInterrupts();

If you want to disable or enable a specific interrupt:

clearIntEnable(...IRQ number...);
// your code
setIntEnable(...IRQ number...);

TechnoX

Sun, 23 Mar 2014 19:59:50 +0000

Thanks for fast reply!

Works perfect with clearIntEnable(_CORE_TIMER_IRQ) and setIntEnable(_CORE_TIMER_IRQ)!

I saw the other thread now when you pointed it out. Seems that I should avoid using plib in the future ;)

Thanks for the help! Now I can continue developing :)