Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joule.md: Added Interrupt Pin assignment information #723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swfFrg
Copy link

@swfFrg swfFrg commented May 8, 2017

Verified that they worked with UBUNTU 16.04 LTS, Joule 570X, Tuchuck, BIOS #174, MRAA V1.5.1-24-g2ea6810

Setup:
use
"#define CHECK_ALL_80_PINS_CONFIGURATION_STATUS 1" if you want to check which pins are interrupt "configurable"
If not defined, one "specified pin" can be tested with the interrupt handler
3 pin switch connected: to 1.8v J13.12 and GND J12.39, switch center pin connected to "Pin55" J13.15 in example below

Qt pseudo code:
init mraa()
call initIsrPins()

void myISR {
static uint32_t myCnt = 0;
qDebug("Interrupt GPIO!!!! %d\n", myCnt++);
}

void initIsrPins(void)
{
mraa_result_t myStatus;
uint8_t myPinNum = 1;

#ifdef CHECK_ALL_80_PINS_CONFIGURATION_STATUS
for(myPinNum = 1; myPinNum <=80; myPinNum++)
{
mraa_gpio_context myIsr = mraa_gpio_init(myPinNum);
#else
mraa_gpio_context myIsr = mraa_gpio_init(55); // Manually enter Pin to test
#endif

   if(myIsr == 0)
       qDebug("FAILED mraa_gpio_context");
   else
   {
       myStatus = mraa_gpio_dir(myIsr, MRAA_GPIO_IN);
       if(myStatus != MRAA_SUCCESS)
           qDebug("FAILED mraa_gpio_dir");
       else
       {
           myStatus = mraa_gpio_isr(myIsr, MRAA_GPIO_EDGE_BOTH, (void (*)(void*)) myISR, NULL);
           if(myStatus != MRAA_SUCCESS)
               qDebug("FAILED mraa_gpio_isr");
           else
               qDebug("Passed:%d", myPinNum);
       }
   }

#ifdef CHECK_ALL_80_PINS_CONFIGURATION_STATUS
}
}

for(;;) { };
}

Signed-off-by: Floyd Goldstein [email protected]

Verified that they worked with UBUNTU 16.04 LTS, Joule 570X, Tuchuck, BIOS eclipse#174, MRAA V1.5.1-24-g2ea6810

Setup: 
use
"#define CHECK_ALL_80_PINS_CONFIGURATION_STATUS  1" if you want to check which pins are interrupt "configurable"
If not defined, one "specified pin" can be tested with the interrupt handler
3 pin switch connected: to 1.8v J13.12 and GND J12.39, switch center pin connected to "Pin55" J13.15 in example below

pseudo code:
init mraa!!!
call initIsrPins()

void myISR {
   static uint32_t myCnt = 0;
   qDebug("Interrupt: POWER_FAIL!!! %d\n", myCnt++);
}

void initIsrPins(void)
{
   mraa_result_t myStatus;
   uint8_t myPinNum = 1;

#ifdef CHECK_ALL_80_PINS_CONFIGURATION_STATUS
   for(myPinNum = 1; myPinNum <=80; myPinNum++)
   {
       mraa_gpio_context myIsrPwrFail = mraa_gpio_init(myPinNum);
#else
       mraa_gpio_context myIsrPwrFail = mraa_gpio_init(55);   // Manually enter Pin to test
#endif

       if(myIsrPwrFail == 0)
           qDebug("FAILED mraa_gpio_context");
       else
       {
           myStatus = mraa_gpio_dir(myIsrPwrFail, MRAA_GPIO_IN);
           if(myStatus != MRAA_SUCCESS)
               qDebug("FAILED mraa_gpio_dir");
           else
           {
               myStatus = mraa_gpio_isr(myIsrPwrFail, MRAA_GPIO_EDGE_BOTH, (void (*)(void*)) ISR_POWER_FAIL, NULL);
               if(myStatus != MRAA_SUCCESS)
                   qDebug("FAILED mraa_gpio_isr");
               else
                   qDebug("Passed:%d", myPinNum);
           }
       }
#ifdef CHECK_ALL_80_PINS_CONFIGURATION_STATUS
   }
}


for(;;) { };
}
Copy link
Contributor

@Propanu Propanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please prefix your commit message with the file/module you are changing. E.g: "joule.md: Added Interrupt ...". Also, don't forget to sign-off your commit. You can use git commit --amend -s --no-edit, more info here.

@swfFrg swfFrg changed the title Added Interrupt Pin information Joule.md: Added Interrupt Pin assignment information May 8, 2017
@arfoll
Copy link
Contributor

arfoll commented May 12, 2017

Unfortunately changing the github issue title in the GUI is not enough, you need to actually amend to change the title, sign it off and push --force it.

@arfoll
Copy link
Contributor

arfoll commented May 28, 2017

If you get a change to fix this it would be great to merge it! Thanks

@arfoll arfoll closed this May 28, 2017
@arfoll arfoll reopened this May 28, 2017
@alext-mkrs
Copy link
Contributor

@swfFrg, could you please do the sign-off mentioned above? We'd be happy to merge your patch, but we can't do this without a signoff (see CONTRIBUTING.md as to why).

@swfFrg
Copy link
Author

swfFrg commented Jun 10, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants