Hi,
 
I'm converting my applications to SDCC PIC14, in one this use a macro to calculate USART baudrate, when compile the code are returned errors:
 
error: missing definition for symbol "__mullong", required by "main.o"
error: missing definition for symbol "__divslong", required by "main.o"
 
If change code lines with macro to main() function this error is not occured.
 
Sample code:
 
//-----------------------------------------------------------------------------
#include "pic16f877defs.h"
 
CONFIG( _CP_ALL & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_ON & _LVP_ON & _BODEN_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC);
 
#define XTAL 20000000
 
//-----------------------------------------------------------------------------
#define LBAUDRATE(b) ((XTAL/(b*64))-1) // Calc BaudRate in Low Speed
#define HBAUDRATE(b) ((XTAL/(b*16))-1) // Calc BaudRate in High Speed
 
//-----------------------------------------------------------------------------
void SerialSetup(long baud)
{
if(baud<=9600)
SPBRG = (unsigned char) LBAUDRATE(baud);
else
SPBRG = (unsigned char) HBAUDRATE(baud);
}
 
//-----------------------------------------------------------------------------
void main(void)
{
SerialSetup(9600);
while(1){
}
}
 
//-----------------------------------------------------------------------------
 
Regards,
 
Luciano
 


Abra sua conta no Yahoo! Mail - 1GB de espašo, alertas de e-mail no celular e anti-spam realmente eficaz.