global printer function

This commit is contained in:
Robin Müller 2020-05-11 12:22:06 +02:00
parent 6dc05e4951
commit effac0e9b7
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#include <framework/globalfunctions/printer.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
void printer::print(uint8_t *data, size_t size) {
sif::info << "StorageAccessor: Printing data: [";
for(size_t i = 0; i < size; i++) {
sif::info << std::hex << (int)data[i];
if(i < size - 1){
sif::info << " , ";
}
}
sif::info << " ] " << std::endl;
}

12
globalfunctions/printer.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_
#define FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_
#include <cstdint>
#include <cstddef>
namespace printer {
void print(uint8_t *data, size_t size);
}
#endif /* FRAMEWORK_GLOBALFUNCTIONS_PRINTER_H_ */