Dave Coleman

Undefined irq functions (5213EVB)

Discussion created by Dave Coleman on Apr 10, 2006
Latest reply on Apr 12, 2006 by Dave Coleman
I've been fighting with this for a while, and I'm running out of ideas. I keep receiving the following errors:

---
Link Error : Undefined : "mcf5xxx_irq_enable"
Referenced from "main" in main.c

Link Error : Undefined : "mcf5xxx_set_handler"
Referenced from "main" in main.c

Link failed.
---

I first started by setting up the PWM, and I've got that working. Then, to test intterupt capability, I wanted to capture the PWM high-times on the GPT port. I've failed to get the interrupts to enable properly. Is there something I'm missing? Below is the code, trimmed to show the important stuff.

---
#include "common.h"
#include

__interrupt__ void gpt_ch0_irq(void)
{
old0 = new0;
new0 = MCF_GPT_GPTC0;
PWM0Data = new0 - old0;
}

__interrupt__ void gpt_ch1_irq(void)
{
old1= new1;
new1 = MCF_GPT_GPTC1;
PWM1Data = new1 - old1;
}

void main()
{

MCF_GPIO_PTDPAR = 0x0F; // Enable port TD to PWM output
MCF_GPIO_DDRTD = 0x0F; // Set port TD to 'output'
GPTInit(); // Init GPT module
ICMInit(); // Init Interrupt Control Module
PWMInit(); // Init PWM module

mcf5xxx_set_handler(64 + 44, gpt_ch0_irq);
mcf5xxx_set_handler(64 + 45, gpt_ch1_irq);
mcf5xxx_irq_enable(); // Enable Interrupts

while(1){}; // Run
}
---

I've included the rest of my code in the attached zip. It's not the cleanest code, but it's been hacked at for the last month, so...

Thanks.

Message Edited by Cheshyr on 04-10-200602:50 PM

Message Edited by Cheshyr on 04-10-200602:50 PM

Outcomes