Author Topic: $50 makefile  (Read 5546 times)

0 Members and 1 Guest are viewing this topic.

Offline javafiendTopic starter

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
$50 makefile
« on: March 04, 2008, 10:55:26 AM »
What is the main difference between the makefile for the $50 robot and the one generated by AVR Studio?

Thanks

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: $50 makefile
« Reply #1 on: March 04, 2008, 01:00:51 PM »
I never really investigated the differences . . . just open up both files and compare.

The one for the $50 Robot came from an old WinAVR install. I only made slight mods to it to get it to work for the $50 Robot.

Offline javafiendTopic starter

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: $50 makefile
« Reply #2 on: March 04, 2008, 01:38:54 PM »
Ok, thanks.  I was just curious as to whether or not is was some custom thing that I'd never understand.

Offline javafiendTopic starter

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: $50 makefile
« Reply #3 on: March 09, 2008, 03:36:17 PM »
Hmm... I'm trying to create a new project in AVR Studio using the $50 Sharp IR program and substituting in bukowski's obstacle avoidance code.  I know the tutorial says to import the makefile, but I'm trying to get this to work with the AVR Studio generated makefile.  Has anyone had any success with this and if so how did you do it?

Admin, I know you said you made slight mods, did they have anything to do with making a2d.h work?  I believe this is where I'm encountering the build errors.

Code: [Select]
C:\AVR\SharpIR_avoid\default/../SharpIR_avoid.c:71: undefined reference to `a2dConvert8bit'
SharpIR_avoid.o: In function `scan':
C:\AVR\SharpIR_avoid\default/../SharpIR_avoid.c:34: undefined reference to `a2dConvert8bit'
SharpIR_avoid.o: In function `initialize':
C:\AVR\SharpIR_avoid\default/../SoR_Utils.h:147: undefined reference to `a2dInit'
C:\AVR\SharpIR_avoid\default/../SoR_Utils.h:148: undefined reference to `a2dSetPrescaler'
C:\AVR\SharpIR_avoid\default/../SoR_Utils.h:149: undefined reference to `a2dSetReference'
make: *** [SharpIR_avoid.elf] Error 1
Build failed with 5 errors and 0 warnings...

This is the only reference I found in the makefile:
Code: [Select]
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c a2d.c

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: $50 makefile
« Reply #4 on: March 15, 2008, 04:23:14 PM »
Yeap, you are getting those errors because you don't have the adc.c and/or adc.h properly linked.

You need it in the makefile as you posted, but also linked in your code:
Code: [Select]
//AVRlib includes
#include "global.h" // include global settings
#include "uart4.h" // include uart function library, includes buffer.h
#include "rprintf.h" // include printf function library
#include "timerx8.h" // include timer function library (timing, PWM, etc)
#include "a2d.h" // include A/D converter function library

Offline javafiendTopic starter

  • Robot Overlord
  • ****
  • Posts: 125
  • Helpful? 0
Re: $50 makefile
« Reply #5 on: March 15, 2008, 06:59:41 PM »
Ok, I have all of that in my SoR_utils.  It's been a few days since I've messed with it, but I've reinstalled WinAVR and AVR Studio since then and it compiled without any errors tonight.  Odd.

 


Get Your Ad Here