#include <p18f4580.h>
#include <stdio.h>
#define mybit PORTBbits.RB1
void Timer1_Delay()
{
T1CON = 0;
TMR1H = 0xFC;
TMR1L = 0x18;
T1CONbits.TMR1ON = 1;
wait:
if (PIR1bits.TMR1IF == 0)
{ goto wait;}
else
{ T1CONbits.TMR1ON = 0;
PIR1bits.TMR1IF = 0;}
}
void main (void)
{ TRISB = 0;
ADCON1 = 0x7F;
while(1)
{
mybit- ~mybit;
Timer1_Delay();
}
}
E:\Retry\main.c:27:Warning [2058] call of function without prototype
Keep getting the following error in MPLab, can't seem to find a way around. Any recommendations would be greatly appreciated!
Actually it's the habit of MPLab to throw warning #2058 when you call the function that takes no parameters even if the function prototype is declared just add the void keyword in function arguments and the problem will be solved like this:
void Timer1_Delay(void)
{
T1CON = 0;
TMR1H = 0xFC;
TMR1L = 0x18;
T1CONbits.TMR1ON = 1;
wait:
if (PIR1bits.TMR1IF == 0)
{ goto wait;}
else
{ T1CONbits.TMR1ON = 0;
PIR1bits.TMR1IF = 0;}
}
Get Answers For Free
Most questions answered within 1 hours.