Basic functionality: CAN IO Manager, unit tests, debug stuff, memory management

This commit is contained in:
Pavel Kirienko
2014-02-01 14:40:09 +04:00
parent b685173185
commit 6c12982b9d
16 changed files with 1739 additions and 52 deletions
@@ -0,0 +1,30 @@
/*
* Debug stuff, should only be used for library development.
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
*/
#pragma once
#if UAVCAN_DEBUG
#include <cstdio>
#include <cstdarg>
#if __GNUC__
__attribute__ ((format (printf, 2, 3)))
#endif
static void UAVCAN_TRACE(const char* src, const char* fmt, ...)
{
va_list args;
std::printf("UAVCAN: %s: ", src);
va_start(args, fmt);
std::vprintf(fmt, args);
va_end(args);
std::puts("");
}
#else
# define UAVCAN_TRACE(...) ((void)0)
#endif