IFlagTemp = __read_irq(); //this is the NEW function I need!
__disable_irq(); //disable all IRQ's
[my code] //my code, NEVER interrupted by any IRQ
if(IFlagTemp) //re-enable IRQ's if necessary
The device driver library you are using might might already have a function called __get_PRIMASK(void).
Retrieving data ...