Extended database on Teensy 3.6

Status
Not open for further replies.

gredpath

Well-known member
I was wondering if anyone had experience of using EDB on the teensy 3.6 using SDIO.
The example as provided never seems to write.
I suspect the issue is that the library tries to write directly to the card byte by byte, instead of by block.
If any one has got this working, it would be good to get your feedback.

I have included the 2 private functions from EDB.cpp
/**************************************************/
// private functions

// low level byte write
void EDB::edbWrite(unsigned long ee, const byte* p, unsigned int recsize)
{
for (unsigned int i = 0; i < recsize; i++)
_write_byte(ee++, *p++);
}

// low level byte read
void EDB::edbRead(unsigned long ee, byte* p, unsigned int recsize)
{
for (unsigned i = 0; i < recsize; i++)
*p++ = _read_byte(ee++);
}

// writes EDB_Header
void EDB::writeHead()
{
edbWrite(EDB_head_ptr, EDB_REC EDB_head, (unsigned long)sizeof(EDB_Header));
}

// reads EDB_Header
void EDB::readHead()
{
edbRead(EDB_head_ptr, EDB_REC EDB_head, (unsigned long)sizeof(EDB_Header));
}

/**************************************************/
// public functions

EDB::EDB(EDB_Write_Handler *w, EDB_Read_Handler *r)
{
_write_byte = w;
_read_byte = r;
}
 
Status
Not open for further replies.
Back
Top