Updated gitignore and added spatz utilities

This commit is contained in:
dario
2024-06-27 16:29:30 +02:00
committed by dario
parent 9eddbaa30f
commit fe3e5d38e4
5 changed files with 112 additions and 3 deletions

42
src/debug/spatz.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include <sta/debug/spatz.hpp>
#ifdef STA_SPATZ_ENABLED
namespace sta
{
namespace spatz
{
sta::Mutex * mutex_;
void init(sta::Mutex * mutex)
{
mutex_ = mutex;
}
void request(uint8_t id, uint8_t * buffer, size_t length)
{
sta::lock_guard lock(*mutex_);
Debug->println(id);
Debug->read(buffer, length);
}
void request(uint8_t id, float * buffer, size_t length)
{
sta::lock_guard lock(*mutex_);
Debug->println(id);
Debug->read(buffer, length);
}
void request(uint8_t id, double * buffer, size_t length)
{
sta::lock_guard lock(*mutex_);
Debug->println(id);
Debug->read(buffer, length);
}
} // namespace spatz
} // namespace sta
#endif // STA_SPATZ_ENABLED