hiveeyes / aerowind-ads1231

An Arduino library to interface the Texas Instruments ADS1231 24-Bit ADC, an analog-to-digital converter for weight scales.
Other
1 stars 0 forks source link

error: 'SREG' was not declared in this scope #1

Closed amotl closed 1 year ago

amotl commented 1 year ago

Problem

../libraries/ADS1231/ADS1231.cpp:30:27: error: 'SREG' was not declared in this scope
         uint8_t oldSREG = SREG;

Solution

// block interrupts
-uint8_t oldSREG = SREG;
-cli();
+noInterrupts();

// reenable interrupts
-SREG = oldSREG;
+interrupts();

See also

amotl commented 1 year ago

Fixed with 2f7a1592f35296ac834a3ceb4c76cf7f4a9b4060.