Jump to content

Recommended Posts

With BoostC, version 6.89, the following snippet of code:

 

#pragma CLOCK_FREQ 20000000

...

delay_us(10);

 

generate the following linker warning: "Caution: argument of 'delay_us' calls must have a value of 1 or more"

 

The generated code looks like:

 

ORG 0x00000010

0010 delay_us_00000

0010 ; { delay_us ; function begin

0010 label1

0010 0000 NOP

0011 0000 NOP

0012 0B92 DECFSZ delay_us_00000_arg_del, F

0013 2810 GOTO label1

0014 0008 RETURN

0015 ; } delay_us function end

...

0237 300A MOVLW 0x0A

0238 0092 MOVWF delay_us_00000_arg_del

0239 2010 CALL delay_us_00000

 

I'm not sure why the warning and I believe that the delay is correct: 10 loops of 5 instruction cycles at .2us/cycle = 10us (plus the overhead of the call - close enough for my purposes)

 

What am I missing - why the warning?

 

Thanks,

Carl Petito

Link to post
Share on other sites
...What am I missing - why the warning?...

 

This is not a warning. This is just a caution message that reminds about delay argument value range. You will get this caution if you use delay calls in your code.

 

Regards,

Pavel

Link to post
Share on other sites
...What am I missing - why the warning?...

 

This is not a warning. This is just a caution message that reminds about delay argument value range. You will get this caution if you use delay calls in your code.

 

Regards,

Pavel

 

Pavel,

 

Thanks for the clarification.

 

As an FYI, the there is no caution generated when using delay_10us(1) - but it does generate a little more code then delay_us(10). Also, delay_ms() and delay_s() do not seem to generate a caution either.

 

Not a big deal.

 

Thanks,

Carl Petito

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...
×
×
  • Create New...