SOLVED petitfatfs function= loop_until_byte_is_set(spsr,spif) was not declared

im working on a drawbitbap from sd function using petitfatfs for a gaming project and I keep getting these errors

Arduino: 1.6.11 (Windows 7), TD: 1.30-beta3, Board: "Teensy 3.2 / 3.1, Serial, 72 MHz optimize speed, US English"

drawBitmapFromSd: In function 'byte rx()':
drawBitmapFromSd:34: error: 'loop_until_bit_is_set' was not declared in this scope
 byte rx() { SPDR=0xFF; loop_until_bit_is_set(SPSR, SPIF); return SPDR; }

                                                        ^

drawBitmapFromSd: In function 'void tx(byte)':
drawBitmapFromSd:35: error: 'loop_until_bit_is_set' was not declared in this scope
 void tx(byte d) { SPDR=d; loop_until_bit_is_set(SPSR, SPIF); }

                                                           ^

the arrow points at the spif in these functions but I cant find any reference or idea on how to fix this error. am I missing a ; or something in the line?

the note for the two functions say they are needed by petitfafs to work. at the moment I have them in the display files cpp but maybe they should be in the .h file or the beginning of the sketch but when I try to compile the original sketch I get the same errors.

Moved to programming questions

drawBitmapFromSd.ino (37.9 KB)

petit_fatfs.zip (17.5 KB)

I forgot to include my library the functions that are being errored are in displayrgb.cpp and.h.

gamebuinoduhjokercolorMAINSD.zip (34.2 KB)

Does any one here know any thing about petitfatfs or should I look else where. I've been researching for days and I have not even remotely found the answers I need about the TX RX lines and thier loop until byte is set function.

Solved

The correct way to define the TX and RX lines to use with petitfatfs is......

byte rx() { return SPI.transfer(0xff);}
void tx(byte d) {SPI.transfer(d);}