1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 23:11:19 +01:00

cpu/atmega_common: Fix return value of irq_enable

Citing the doc of irq_enable():

    @return Previous value of status register. [...]

On atmega however the new value of the status register is returned, not the one
prior to enabling interrupts.
This commit is contained in:
Marian Buschsieweke 2019-04-25 12:14:18 +02:00
parent 215d5cdc1c
commit 48fabca38d
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -70,8 +70,9 @@ unsigned int irq_disable(void)
*/
unsigned int irq_enable(void)
{
uint8_t mask = __get_interrupt_state();
sei();
return __get_interrupt_state();
return mask;
}
/**