1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 18:12:46 +01:00

cpu/atmega_common: make cppcheck happy

This commit is contained in:
Marian Buschsieweke 2021-11-16 16:20:26 +01:00
parent 69dadf61e9
commit d91c9cdc5a
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -337,16 +337,17 @@ int gpio_init_int(gpio_t pin, gpio_mode_t mode, gpio_flank_t flank,
EIMSK |= (1 << int_num); EIMSK |= (1 << int_num);
/* apply flank to interrupt number int_num */ /* apply flank to interrupt number int_num */
if (int_num < 4) {
EICRA &= ~(0x3 << (int_num * 2));
EICRA |= (flank << (int_num * 2));
}
#if defined(EICRB) #if defined(EICRB)
else { if (int_num >= 4) {
EICRB &= ~(0x3 << ((int_num % 4) * 2)); EICRB &= ~(0x3 << ((int_num % 4) * 2));
EICRB |= (flank << ((int_num % 4) * 2)); EICRB |= (flank << ((int_num % 4) * 2));
} }
else
#endif #endif
{
EICRA &= ~(0x3 << (int_num * 2));
EICRA |= (flank << (int_num * 2));
}
/* set callback */ /* set callback */
config[int_num].cb = cb; config[int_num].cb = cb;