first
This commit is contained in:
63
apps/common/debug/debug.c
Normal file
63
apps/common/debug/debug.c
Normal file
@ -0,0 +1,63 @@
|
||||
#include "app_config.h"
|
||||
#include "typedef.h"
|
||||
|
||||
|
||||
|
||||
#ifndef CONFIG_DEBUG_ENABLE
|
||||
|
||||
int putchar(int a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
int puts(const char *out)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int printf(const char *format, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void put_buf(const u8 *buf, int len)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void put_u8hex(u8 dat)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void put_u16hex(u16 dat)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void put_u32hex(u32 dat)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void log_print(int level, const char *tag, const char *format, ...)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DEBUG_LITE_ENABLE
|
||||
void log_putbyte(char c)
|
||||
{
|
||||
|
||||
}
|
||||
#endif /* #ifndef CONFIG_DEBUG_LITE_ENABLE */
|
||||
|
||||
int assert_printf(const char *format, ...)
|
||||
{
|
||||
cpu_assert_debug();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
68
apps/common/debug/debug_lite.c
Normal file
68
apps/common/debug/debug_lite.c
Normal file
@ -0,0 +1,68 @@
|
||||
#include "app_config.h"
|
||||
#include "typedef.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_LITE_ENABLE
|
||||
|
||||
extern void putbyte(char a);
|
||||
|
||||
#define putbyte_lite putbyte
|
||||
|
||||
void log_putbyte(char c)
|
||||
{
|
||||
putbyte_lite(c);
|
||||
}
|
||||
|
||||
void puts_lite(const char *out)
|
||||
{
|
||||
while (*out != '\0') {
|
||||
putbyte_lite(*out);
|
||||
out++;
|
||||
}
|
||||
}
|
||||
|
||||
int printf_lite(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
return print(NULL, 0, format, args);
|
||||
}
|
||||
|
||||
void put_buf_lite(void *_buf, u32 len)
|
||||
{
|
||||
u8 *buf = (u8 *)_buf;
|
||||
printf_lite("\n0x%x\n", buf);
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (((i % 16) == 0) && (i != 0)) {
|
||||
putbyte_lite('\n');
|
||||
}
|
||||
printf_lite("%x", buf[i]);
|
||||
putbyte_lite(' ');
|
||||
}
|
||||
putbyte_lite('\n');
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
||||
void puts_lite(const char *out)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void put_buf_lite(void *_buf, u32 len)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
int printf_lite(const char *format, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* #ifdef CONFIG_DEBUG_LITE_ENABLE */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user