I am trying to use the LibreRTOS on a SAMD21. It has examples for the ATMEGA382 but not for the SAMD21. This piece of code is what is confusing to me as I dont have much experience with assembler anymore.
What are they storing for recovery later and how would I do that on the SAMD21 chip.
Any insights welcome here.
/* Nested critical section management macros. */ #define CRITICAL_VAL() uint8_t __istate_val #define CRITICAL_ENTER() __asm __volatile( \ "in %0, __SREG__ \n\t" \ "cli \n\t" \ :"=r" (__istate_val) ::"memory") #define CRITICAL_EXIT() __asm __volatile( \ "out __SREG__, %0 \n\t" \ ::"r" (__istate_val) :"memory")