New Sleep APi throwing error

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

SystemSleepConfiguration config;
config.mode(SystemSleepMode::STOP)
      .gpio(D2, RISING)
      .duration(30s)
      .network(NETWORK_INTERFACE_CELLULAR);
SystemSleepResult result = System.sleep(config);

When compiling it says:

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

Any suggestions?
Thanks

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.