diff --git a/include/sta/debug/printing/printable_printf.hpp b/include/sta/debug/printing/printable_printf.hpp index 0d51f04..2ef9ed6 100644 --- a/include/sta/debug/printing/printable_printf.hpp +++ b/include/sta/debug/printing/printable_printf.hpp @@ -23,6 +23,4 @@ namespace sta }; } // namespace sta - - #endif // STA_CORE_PRINTABLE_PRINTF_HPP \ No newline at end of file diff --git a/include/sta/devices/template/custom_printable.hpp b/include/sta/devices/template/custom_printable.hpp new file mode 100644 index 0000000..594ba31 --- /dev/null +++ b/include/sta/devices/template/custom_printable.hpp @@ -0,0 +1,34 @@ +#ifndef STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP +#define STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP + +#include + +#if defined(STA_PLATFORM_YOUR_DEVICE) || defined(DOXYGEN) + +#include + +namespace sta +{ + class CustomPrintable : public Printable + { + public: + /** + * @brief Constructor for your custom printable. + * + * Delete if not needed. + */ + CustomPrintable(/* YOUR ARGMENTS */); + + /** + * @brief Print string. + * + * @param str String buffer + * @param length String length + */ + void print(const char * str, size_t length) override; + }; +} // namespace sta + +#endif // STA_PLATFORM_YOUR_DEVICE + +#endif // STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP \ No newline at end of file diff --git a/src/devices/template/custom_printable.cpp b/src/devices/template/custom_printable.cpp new file mode 100644 index 0000000..590859a --- /dev/null +++ b/src/devices/template/custom_printable.cpp @@ -0,0 +1,18 @@ +#include + +#ifdef STA_PLATFORM_YOUR_DEVICE + +#include + +namespace sta +{ + void CustomPrintable::print(const char * str, size_t length) + { + STA_ASSERT(str != nullptr); + STA_ASSERT(length > 0); + + // YOUR CODE HERE + } +} // namespace sta + +#endif // STA_PLATFORM_YOUR_DEVICE