Hi,
I've a custom board with ATMEGA256RFR2 on which I'm using 3 simple buttons with pullup resistors. All are connected to the straightforward interrupt pins on INT4,5,6.
I'm trying to use them, but my ISR's are not getting called through BitCloud. (Normally, with manual ISR functions they work fine):
volatile uint8_t test = 0;
void Button1InterruptHandler() {
if (0 == test) {
test=1;
PORTB ^= (1<<PB3); //This should flip PB3 only once. But it remains VDD.
}
}
uint8_t setupISR() {
DDRB |= (1<<PB3);
PORTB |= (1<<PB3); //Test pin, set it to VDD
if (0 != HAL_RegisterIrq(INT4, IRQ_LOW_LEVEL, Button1InterruptHandler))
return BC_FAIL;
}
...
setupISR();
...
Do I miss something? I wouldn't like to deepdive into HAL functions if the code above contains some simple bug.
Thanks!