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.

Orange pi One, interrupts gpio problem

Featured Replies

Hi, my environment is:

Orange Pi One

ARMBIAN 5.34.171031 nightly Ubuntu 16.04.3 LTS 4.11.12-sun8i

WiringPi fork by WereCatf:

git clone https://github.com/WereCatf/WiringOP.git -b h3

./build

 

small c++ programm:

 

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <wiringPi.h>
#include <pthread.h>


static volatile int globalCounter;

void myInterrupt(void) {
    ++globalCounter;
    printf("InterruptCounter: %5d\n", globalCounter);
    //digitalRead(7);
}

int main(void)
{
    if (wiringPiSetup() == -1) {
        printf("wiringPiSetup Error\n");
    }
    pinMode(7, INPUT);
    pullUpDnControl(7, PUD_UP);
    if (wiringPiISR(7, INT_EDGE_FALLING, &myInterrupt) < 0)
    {
        fprintf(stderr, "Unable to setup ISR: %s\n", strerror(errno));
        return 1;
    }
    for (;;)
    {
    //main programm code here...
    }
    return 0;
}
 

 

Compile:

gcc ./isr.c -o wg-daemon.out -lwiringPi -lwiringPiDev -lpthread -lm

 

and run it...

 

but when I put pin 7 in down state (gpio mode 7 down) ISR function begin fires (triggers) continuously (((((((

Here is output :

 

InterruptCounter: 132371
InterruptCounter: 132372
InterruptCounter: 132373
InterruptCounter: 132374
InterruptCounter: 132375
InterruptCounter: 132376
InterruptCounter: 132377
InterruptCounter: 132378
InterruptCounter: 132379
InterruptCounter: 132380
InterruptCounter: 132381
^C
root@orangepione:~/example#
 

 

but, when I add to ISR function 

"digitalRead(7);"

program works fine (((

 

 

 

Please tell me, what I do wrong

 

 

  • Author

Anyone()

 

I just test this code with Raspberry Pi 3 and Wiring Pi library, all works perfect()

But on orange pi one still this problem(

I am observing the exact same behavior with the Orange Pi PC:

 

Hi, my environment is:

Orange Pi PC

BOARD=orangepipc
BOARD_NAME="Orange Pi PC"
BOARDFAMILY=sun8i
VERSION=5.38
LINUXFAMILY=sunxi
BRANCH=next
ARCH=arm
IMAGE_TYPE=stable
BOARD_TYPE=conf
INITRD_ARCH=arm
KERNEL_IMAGE_TYPE=zImage

 

WiringPi fork by WereCatf:

 

Do you have any newer information/insights on that matter?

 

Anayway, does calling digitalRead() in the interrupt-routine cause any problems? If not, this work around is acceptable for me. Thanks for the hint. :-)

 

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.