I keep getting this error …
TCS_Utils\TCS_PIT.o: In function `InitMsPit':
C:\NetBurner\workspace\TCS_V0\Release/..\TCS_Utils/TCS_PIT.cpp:69: undefined reference to `SetIntc'
I have included all the includes so I am wondering why I am getting this error - any help would be appreciated.
----------------------------------
#include <predef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <startnet.h>
#include <ucos.h>
#include <pins.h>
#include <rtc.h>
#include <utils.h>
#include <i2cmaster.h>
#include <buffers.h>
#include <serial.h>
#include <cfinter.h>
#include <serinternal.h>
#include <constants.h>
#include <sim5234.h>
#include "TCS_System.h"
extern "C"
{
void SetIntc(int , long , int , int , int );
}
volatile DWORD TickCount = 0 ;
// Update the counters on a millisecond tick
INTERRUPT(TickService, 0x2600)
{
WORD tmp = sim.pit[PIT_MS].pcsr; // PIT Control and Status register
// Reset the interrupt
tmp &= 0xFF0F;
tmp |= 0x0F;
sim.pit[PIT_MS].pcsr = tmp;
if(TickCount++ > 999)
{
TickCount = 0 ;
}
}
void InitMsPit()
{
WORD tmp = 0 ;
WORD ClockInterval = 4607; // 1 ms
BYTE pcsr_pre = 4 ; // Prescaler - divide by 16
SetIntc(0,(long)&TickService, 36 + PIT_MS,2,3);
sim.pit[PIT_MS].pmr = ClockInterval;
tmp = pcsr_pre;
tmp = (tmp <<8)|0x0F;
sim.pit[PIT_MS].pcsr = tmp; // System Clock Divisor to 16 and bit [3:00 in PCSR
}
SetIntC - undefined reference
Re: SetIntC - undefined reference
I believe this question was resolved through support, but wanted to post the solution for others. The extern "C" needed to be removed from the function prototype.
Re: SetIntC - undefined reference
Thank you
Removing the extern "C" resolved the problem.
extern void SetIntc(int intc, long func, int vector, int level, int prio); // Interrupt Setting
Removing the extern "C" resolved the problem.
extern void SetIntc(int intc, long func, int vector, int level, int prio); // Interrupt Setting