New Sleep APi throwing error

so I wanted to use the new sleep api as follows:

SystemSleepConfiguration config;
      .gpio(D2, RISING)
SystemSleepResult result = System.sleep(config);

When compiling it says:

error: expected unqualified-id before numeric constant
#define STOP 1

Any suggestions?

Most likely something in your code has a

#define STOP 1

Since #define are expanded first, this results in SystemSleepMode::STOP being interpreted as SystemSleepMode::1 which is not valid.

thanks, this was it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.