Search found 4 matches
- Tue Mar 08, 2022 6:40 am
- Forum: General discussion
- Topic: Interrupts call not working
- Replies: 6
- Views: 3336
Re: Interrupts call not working
UPDATE: The original piece of code works in PlatformIO. Looks like Arduino IDE is a problem here.
- Tue Mar 08, 2022 4:07 am
- Forum: General discussion
- Topic: Interrupts call not working
- Replies: 6
- Views: 3336
Re: Interrupts call not working
This will effectively make the class static, right? So there will be only one instance possible.
- Mon Mar 07, 2022 8:36 pm
- Forum: General discussion
- Topic: Interrupts call not working
- Replies: 6
- Views: 3336
Re: Interrupts call not working
Yes, it's a pointer.
I tried to rewrite it the following way but the static method still isn't called
extern "C" {
void _onInterrupt(void)
{
digitalWrite(PC13, LOW);
//_thePSM->calculateSkip();
}
}
PSM::PSM(uint32_t sensePin, uint32_t mode)
{
_thePSM = this;
pinMode(sensePin, INPUT_PULLUP ...
I tried to rewrite it the following way but the static method still isn't called
extern "C" {
void _onInterrupt(void)
{
digitalWrite(PC13, LOW);
//_thePSM->calculateSkip();
}
}
PSM::PSM(uint32_t sensePin, uint32_t mode)
{
_thePSM = this;
pinMode(sensePin, INPUT_PULLUP ...
- Mon Mar 07, 2022 4:01 pm
- Forum: General discussion
- Topic: Interrupts call not working
- Replies: 6
- Views: 3336
Interrupts call not working
Hello all,
Could anyone explain me what's wrong with this code in a C++ library:
.h file
class PSM
{
public:
PSM(uint32_t sensePin, uint32_t mode = RISING);
static void onInterrupt();
unsigned int cps();
private:
void calculateSkip();
volatile unsigned int _a;
};
.cpp file
static ...
Could anyone explain me what's wrong with this code in a C++ library:
.h file
class PSM
{
public:
PSM(uint32_t sensePin, uint32_t mode = RISING);
static void onInterrupt();
unsigned int cps();
private:
void calculateSkip();
volatile unsigned int _a;
};
.cpp file
static ...