Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: cannot convert 'volatile uint32_t*' to 'volatile uint8_t*' #2

Closed
amotl opened this issue May 27, 2023 · 1 comment
Closed

error: cannot convert 'volatile uint32_t*' to 'volatile uint8_t*' #2

amotl opened this issue May 27, 2023 · 1 comment

Comments

@amotl
Copy link
Member

amotl commented May 27, 2023

Problem

../libraries/ADS1231/ADS1231.cpp:33:13: error: cannot convert 'volatile uint32_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
         out = portOutputRegister(ADS1231s[this->ADS1231Index].sclPort);

Solution

ADS1231.h

#ifdef __SAM3X8E__
  typedef volatile RwReg PortReg;
  typedef uint32_t PortMask;
#elif defined(ESP8266)
  typedef volatile uint32_t PortReg;
  typedef uint32_t PortMask;
#else
  typedef volatile uint8_t PortReg;
  typedef uint8_t PortMask;
#endif

ADS1231.cpp

-volatile uint8_t *out;
+volatile PortReg *out;

See also

@amotl
Copy link
Member Author

amotl commented May 27, 2023

Fixed with 1bd7d7c.

@amotl amotl closed this as completed May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant