Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Oragnepi zero Plus H5 ISR Problem

Featured Replies

Hi i wonder why ISR result is strange

 

first i test in orangepi zero Plus H5

that result is repeated infinite recall function   

summary - recall infinite function if i input interrupt pin(button)

 

i test

result repeat

second i test in orangepi zero(H2)

that result is only called function once

 

#include <wiringPi.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

void signal_both(void){
  printf("Signal Both\n");
}void signal_falling(void){
  printf("Signal Falling\n");
}void signal_rising(void){
  printf("Signal Rising\n");
}int main(int argc, char **argv){
  int mode=INT_EDGE_BOTH;
  int pin = 0;
  if(wiringPiSetup() == -1) {
    printf("wiringPiSetup Error\n");
  }
  if (argc == 2) {
    mode = atoi(argv[1]);
  }
  if (argc == 3) {
    mode = atoi(argv[1]);
    pin = atoi(argv[2]);
  }
  pinMode(pin,INPUT);
  printf("pin=%d\n",pin);
  if ( mode == INT_EDGE_BOTH) {
    printf("INT_EDGE_BOTH\n");
    wiringPiISR(pin, INT_EDGE_BOTH, signal_both );
  } else if ( mode == INT_EDGE_FALLING) {
    printf("INT_EDGE_FALLING\n");
    wiringPiISR(pin, INT_EDGE_FALLING, signal_falling );
  } else if ( mode == INT_EDGE_RISING) {
    printf("INT_EDGE_RISING\n");
    wiringPiISR(pin, INT_EDGE_RISING, signal_rising );
  }
  while(1) {
    sleep(10000);
  }
  return 0;
}

 

can you explain why result is different?

code is same in Orange Pi Zero and Orange Pi Zero Plus H5

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.