Author Topic: attachInterrupt() wrong number of parameters  (Read 3944 times)

jfp

  • RFduino Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
attachInterrupt() wrong number of parameters
« on: February 20, 2014, 12:06:43 PM »
Hi,

Trying the library InterruptChain I have found the following problem:

from the arduino reference documentation
http://arduino.cc/en/Reference/AttachInterrupt

the routine attachInterrupt should have 3 parameters:
attachInterrupt(interrupt, ISR, mode) 

But from the RFduino WInterrupt.h (.c) file
the routine has the signature
void attachInterrupt(uint8_t IRQn, callback_t callback);

Is it a bug in the core library ?

Regards,

JFP
« Last Edit: February 24, 2014, 11:02:51 PM by jfp »

gwenhastings

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: attachInterrupt() wrong number of parameters
« Reply #1 on: February 25, 2014, 10:54:09 AM »
Yep I just ran into this also.. lots of code I have using interrupts WONT compile on rfduino as a result..WTF.??

Why is this project modifying CORE library calls in this fashion..frankly as a developer to give this board special care and handling and make ALL the other stuff I compile on Arduino broken is NOT worth the tradeoff I am ready to throw rfduino in the trash and reinstall arduino core without these BS additions...

OpenLRSng
MultiWii and
most of my other flight controller builds have been broken by this "CRAP" change to CORE functions

     Someone in the RFDUINO crew needs to start realizing that most developers use their Arduino environment for many more things than simply RFDUINO and breaking CORE function calls without warning tends to get folks somewhat incensed and not willing to use such a tool further.

on the other hand had instructions been provided to make a dedicated turnkey Arduino IDE ahead of time just for rfduino.. then objections would not be so severe.. it APM/Ardupilot  does it for their builds.

Now IF in fact you documented in the release notes that you were breaking CORE my apologies.. but I have NOT found any mention of it.. simply my broken build environment needing reinstall.


     grumpily
     gwen


edorphy

  • RFduino Full Member
  • ***
  • Posts: 86
  • Karma: +0/-0
    • View Profile
Re: attachInterrupt() wrong number of parameters
« Reply #2 on: February 25, 2014, 09:41:27 PM »
JFP,

Look at the programming reference, you have to call some RFduino (pin_woke, etc) methods, which I'm guessing are wrapper methods to the traditional method you are referencing in the arduino link.

The RFduino is NOT an AVR chip. For example, the DUE is an ARM cortex atmel chip, just like the RFduino. The way in which interrupts are set is different because you can interrupt on ANY and ALL pins.

When you buy an arduino due there is a disclaimer that not all of the libraries will function properly (as they are not developed for the arm architecture, the register names are not consistent). Unfortunately, the same applies for the rfduino :/

Do we know if these are external interrupts or pin change interrupts as it might affect the ISR and how they are called?

gwenhastings,

I am curious about your core libraries being affected because you should have a different core for each arduino type in arduino 1.5.x.

Ex. I got avr, due, and rfduino. Each with their own core folders. When you select a board I think the IDE switches the folder it references. (correct me if I'm wrong)

I agree that the methods could be wrapped a little better to mirror the arduino calls for consistency.

gwenhastings

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: attachInterrupt() wrong number of parameters
« Reply #3 on: February 25, 2014, 10:16:51 PM »
Hi Edorphy,
           code which already contains attachInterrupts ALL has to be changed to work with the rfduino style call and retested . that is a big one right there.(ie SQA is a must here as the rfduino was to be part of an airborne radiation mapping package)

Conformance and agreements on how attachInterrupts is implemented as  programming interface has VERY little to do with lowlevel interrupt programming in this case OR chip type,

ie pin, ISR and type  wrappers in the core libs can be implemented on a variety of processors without causing this kind of "oops".

ie in the Linux world as well as Unix we have had POSIX conformance for years for these kinds of issues so code compiles and work uniformly across a number of processor chip architectures.

Arduino core function definition(s) are in the same class of conformance and yes the number of parameters is NOT expected to deviate from core nor have a different number or type of parameters..

if in fact that is what has occurring then I suggest rfduino is running counter to the entire body of user programming experience available for the arduino no matter what the chip type,

as for moi, the rfduino is essentially useless in its present form and implementation given that bootloader sources and the shim to the softdevice are not available means I cant load for example BlePP even it I do buy a developer kit or reload the rfduino code should I choose to change the bootloader...

in essence I have purchased parts which CANT be restored to full function once programmed..

no thanx the rfduino is headed for that recycle bin in the sky

It had been intended as part of a geomapping airborne radiation mapping drone(which I was going to build many many copies of)  but I will use a standard arduino nano instead which doesnt need to alter core calls like attachInterrupts for prototype and move to a low cost device like a MCHCK  or use the sparc processor on the wifly module being implement on the craft its too bad rfduino looked promising before I started running into all these gotchas.


Code maintenance depending on standard calls DOES matter to some of us who write code.

      grumpily
      gwen
ps rfduino now has been removed from this project as I DONT have type for this kind of catfight while prototyping code and hardware. Someone SHOULD rethink this approach to attachInterrupt.. there is no good reason to change it like this, chip architecture not withstanding.  This was a major fail in at least 2 peoples opinions.
« Last Edit: February 25, 2014, 10:35:17 PM by gwenhastings »

mkay

  • RFduino Team
  • *****
  • Posts: 405
  • Karma: +15/-0
    • View Profile
Re: attachInterrupt() wrong number of parameters
« Reply #4 on: March 07, 2014, 09:41:54 AM »
Hi everyone, we have taken notes of your comments and will be looking at this. Thanks for bringing it to our attention. We are very busy with some very cool exciting new stuff coming real soon, so as soon as we have a chance, we'll take a look  :)

 

anything