AS7 Dependencies - Can I add a 'Dependency?'

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I installed AS7, and using my STK500, and writing code to blink an LED on the ATMEGA168.

I realized I don't have a delay routine and I'm not sure if I can added one (Dependency ?) that will contain a delay function that I can call in my code.

Attached is a screen capture of the Dependency .h files that are in my project.  I looked at all of them and noticed there's no delay routine.

 

Can I create a .h file with a delay routine and add it to my project?  

 

Thanks,

 

Brian

 

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Spin-loop delay routines are available using util/delay.h. See the avrlibc documentation for details.

 

EDIT: Correction of include directory.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Fri. Nov 10, 2017 - 11:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rather than attach a PDF, it would be better to simply embed the image - instructions here: http://www.avrfreaks.net/comment...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "Dependencies" is something that AS works out for itself - not something that you manually create or adjust.

 

As Johan suggested, you simply 

#include <avr/delay.h>

and AS will spot that as a Dependency

 

Because this is a standard part of the toolchain, that is all you have to do - the implementations of the library functions are included in the distribution.

 

When adding 3rd-party code, you will also have to add the implementations to your Project.

 

There was a similar question a little while back - but I can't seem to find it at the moment ...

 

EDIT

 

Johan has now corrected his post; it should actually be:

 

#include <util/delay.h>

 

see following posts...

Last Edited: Fri. Nov 10, 2017 - 11:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
As Johan suggested, you simply

 #include <avr/delay.h>

You will have more success with:

#include <util/delay.h>

;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh, darn.. That's what happens when posting from the PAD. I'll correct it.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]