SLEEP_MODE_CPU not declared


#1

I added System.sleep(SLEEP_MODE_CPU); in my void loop(); but when I compile I get this error:

main.cpp:91:16: error: ‘SLEEP_MODE_CPU’ was not declared in this scope.

I tried adding application.h header and SYSTEM(MANUAL); but nothing seemed to get around the compile error.

I could of course run my project without it but since this is the large announcement on the front of the doc page I figured I would want to have it working correctly.


#2

Is this in the Web IDE? Are you sure you have a bluz device selected from the device list? Compiling for any other platform will result in this error.


#3

No, I don’t use the web IDE. I have been doing all my development with the particle compile/flash command line tool. I am a VIM kind of guy and wasn’t much of a fan of the web IDE. If that is the only way to get it flashed with that line though, I will just copy my code over and insert that line when I am ready for production.


#4

particle compile bluzdk  1

Target device bluzdk is not valid
eg. particle compile core xxx
eg. particle compile photon xxx

Updating this would be sweet.


#5

Are you on the absolute latest CLI version? I thought maybe Particle had added that. If not, I will check with them


#6

That was exactly it. I was rocking a super old version. Updated and now “bluz” is a supported device to compile and flash too. Thanks for the help!