Jump to content
Sign in to follow this  
Mike Schafer

Pic18 Sleep Function

Recommended Posts

Sleep function inserts a no-op in the assembly code rather than 0003 op code

 

#include <system.h>

 

void main(void)

{

while(1)

{

sleep();

}

}

 

Gives:

 

0004 main

; { main ; function begin

0004 label268435976

0004 0000 SLEEP

0006 EF02F000 GOTO label268435976

; } main function end

 

Sleep should be 0003.

 

Same happens if you use

 

asm sleep

 

Inserting data to make the sleep op code is a work around:

 

asm data 0,3

 

IDE 5.9.5

BoostC 2.2 beta

18F4620

Window OS

 

 

Regards,

 

Mike

Share this post


Link to post
Share on other sites

Mike,

 

This one is now fixed, so will be correct in the next release.

 

Thanks for the bug report.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Mike,

 

This fixed is now available in BoostC release V2.2.2

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...