I try to use it:
inline void spi_send(unsigned char cmd)
{
SSPBUF = cmd;
while(!SSPSTATbits.BF);
}
but compile failed:
sdcc --std-sdcc99 --use-non-free main.c -mpic16 -p18f46k22
main.asm:19:Error [113] Symbol not previously defined (_spi_send).
I read main.asm:
;--------------------------------------------------------
; public variables in this module
;--------------------------------------------------------
global _spi_init
global _spi_send
global _main
O.o global _spi_send, it's a bug. It's a inline function, it dosen't exists in asm.
bug fix
I fixed it. Attached patch inline-bug.patch. It's work for me.