SDFileSystem - error: 'STA_PROTECT' was not declared in this scope

I think I’ve found a bug in SDFileSystem, but I’m not sure if it’s just something I’m doing,
a quirk of EmBitz or a genuine bug.

Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp: In member function ‘virtual int SDFileSystem::disk_write(const uint8_t*, uint64_t, uint8_t)’:
Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp:338:20: error: ‘STA_PROTECT’ was not declared in this scope
if (m_Status & STA_PROTECT)
^
Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp:339:16: error: ‘RES_WRPRT’ was not declared in this scope
return RES_WRPRT;
^

I’ve establised that both STA_PROTECT and RES_WRPRT are declared in diskio.h and that changing #include "diskio.h" to #include "FATFileSystem/ChaN/diskio.h" solves the issue.

Does anyone else get this issue?

I’ve uploaded a minimal version of my setup, just drag these files into the root of a fresh copy of PokittoLib (allowing my .ebp to overwrite the existing .ebp, the ‘root’ being where the .ebp file is located).

Ok so I grabbed a fresh copy of PokittoLib and replaced the .ebp with yours and then I have tried to build the FileTest program. I am getting the same errors:

Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp: In member function 'virtual int SDFileSystem::disk_write(const uint8_t*, uint64_t, uint8_t)':
Creating Hex-file.
Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp:338:20: error: 'STA_PROTECT' was not declared in this scope
     if (m_Status & STA_PROTECT)
                    ^
Pokitto\POKITTO_LIBS\SDFileSystem\SDFileSystem.cpp:339:16: error: 'RES_WRPRT' was not declared in this scope
         return RES_WRPRT;
1 Like