Porting Sleep Function Issues | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Porting Sleep Function Issues
September 9, 2016
7:30 pm
Avatar
LDBM
Member
Members
Forum Posts: 11
Member Since:
August 8, 2016
sp_UserOfflineSmall Offline

Hi,

I am trying to create a VI that implements a different sleep function (SLEEP_MODE_IDLE )  than the one available in the toolkit (SLEEP_MODE_PWR_DOWN).

Since there is no input / output,  I create from the template lvlib a Shutdown library that looks like this:

shutdownLib.PNGImage Enlarger

with Shutdown_Idle only containing Error in and Out clusters since the shutdown is just a call onto the sleep.h API.

shutdownVI.PNGImage Enlarger

The translator.vi, since not using any I/O,  I suppose can be reduced to this:

translator.PNGImage Enlarger

When creating a basic test.vi and looking into the code generated, it shows the following, which I assumed indicated the translator was ok:

#include "LVArray.h"
#include "A4Lhelper.h"
#include sleep.h
void setup()
{
    set_sleep_mode(SLEEP_MODE_IDLE);  
      sleep_enable();  
      sleep_mode();  
      /** The program will continue from here. **/  
      /* First thing to do is disable sleep. */  
      sleep_disable();
    
}

void loop()
{
}

Also, the sleep.h file was placed into the [libraries] folder like the the template shows. It was copied from the arduino install folder.

Now when I use my new VI that is supposed to implement the new Sleep function, the compile fails and returns the error below:

1.0.0.21, Arduino/Genuino Uno
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
temp:13: error: #include expects "FILENAME" or

 #include sleep.h

          ^

exit status 1
#include expects "FILENAME" or

Does that mean it does not find the sleep.h after all, or it should use the one from the arduino's install folder??

Thx.

ldbm.

sp_PlupAttachments Attachments
September 9, 2016
8:47 pm
Avatar
LDBM
Member
Members
Forum Posts: 11
Member Since:
August 8, 2016
sp_UserOfflineSmall Offline

...Oops...

#include sleep.h

should have been

#include "sleep.h"

September 9, 2016
9:20 pm
Avatar
LDBM
Member
Members
Forum Posts: 11
Member Since:
August 8, 2016
sp_UserOfflineSmall Offline

Better yet:

 

#include <avr/sleep.h>

April 5, 2017
7:09 am
Avatar
David
Member
Members
Forum Posts: 22
Member Since:
January 28, 2017
sp_UserOfflineSmall Offline

Did you finish a port that you'd be willing to share?

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
6
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356