Hello to everyone,
i have written a function that’s worked for arduino Meaga/Uno - but now i would get it work on the DUE.
The code look like:
inline void getCommandData(uint16_t* data, uint8_t numOfChannel)
{
uint8_t l_oldSREG;
// remember status register
l_oldSREG = SREG;
// disable Interrupts
noInterrupts();
// get the data
for(uint8_t i = 0; i<numOfChannel; i++)
{
data[i] = m_ChannelData[i];
}
// put status register back
SREG = l_oldSREG;
// enable Interrupts
interrupts();
}
But this doesn’t work, because the SREG are not available on the DUE.
Does it exists for the due such an Status Register and how can I access it?
Any help appreciated. Thanks you!