WIP: somethings wrong.. #19

Closed
muellerr wants to merge 808 commits from source/master into master
Showing only changes of commit 1631e739b8 - Show all commits

View File

@ -5,6 +5,8 @@
// to be implemented by bsp
extern "C" void printChar(const char*);
int ServiceInterfaceBuffer::overflow(int c) {
// Handle output
putChars(pbase(), pptr());
@ -19,16 +21,18 @@ int ServiceInterfaceBuffer::overflow(int c) {
return 0;
}
// custom stdio.c library for at91sam9g20 chip which does not support unsigned long
// So I cast (unsigned int) on loggerTimes
int ServiceInterfaceBuffer::sync(void) {
if (this->isActive) {
Clock::TimeOfDay_t loggerTime;
Clock::getDateAndTime(&loggerTime);
char preamble[96] = { 0 };
sprintf(preamble, "%s: | %lu:%02lu:%02lu.%03lu | ",
this->log_message.c_str(), (unsigned long) loggerTime.hour,
(unsigned long) loggerTime.minute,
(unsigned long) loggerTime.second,
(unsigned long) loggerTime.usecond /1000);
sprintf(preamble, "%s: | %u:%02u:%02u.%03u | ",
this->log_message.c_str(), (unsigned int) loggerTime.hour,
(unsigned int) loggerTime.minute,
(unsigned int) loggerTime.second,
(unsigned int) loggerTime.usecond /1000);
// Write log_message and time
this->putChars(preamble, preamble + sizeof(preamble));
// Handle output