2012-08-31 10:34:49 +02:00
|
|
|
#include "main.h"
|
|
|
|
#include "gecko.h"
|
|
|
|
#include "Network/wifi_gecko.h"
|
|
|
|
|
2012-11-12 13:21:55 +01:00
|
|
|
extern "C" void sdprintf(const char * format, ...)
|
2012-08-31 10:34:49 +02:00
|
|
|
{
|
2012-11-12 13:21:55 +01:00
|
|
|
char * tmp = NULL;
|
|
|
|
va_list va;
|
|
|
|
va_start(va, format);
|
|
|
|
if((vasprintf(&tmp, format, va) >= 0) && tmp)
|
|
|
|
{
|
|
|
|
FILE * file;
|
|
|
|
|
2013-01-04 19:17:47 +01:00
|
|
|
file = fopen("sd1:/config/HBF/debug.txt", "a");
|
2012-11-12 13:21:55 +01:00
|
|
|
if(file)
|
|
|
|
{
|
|
|
|
fprintf(file, "%s", tmp);
|
|
|
|
fclose(file);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
va_end(va);
|
|
|
|
|
|
|
|
if(tmp)
|
|
|
|
free(tmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
extern "C" void xprintf(const char *str, ...)
|
|
|
|
{
|
|
|
|
if(Options.sdgecko)
|
|
|
|
sdprintf(str);
|
2013-01-04 19:17:47 +01:00
|
|
|
|
2016-08-15 22:18:41 +02:00
|
|
|
if(Options.wifigecko)
|
2012-08-31 10:34:49 +02:00
|
|
|
wifi_printf(str);
|
2016-08-15 22:18:41 +02:00
|
|
|
|
|
|
|
if(!Options.wifigecko && !Options.sdgecko)
|
2012-08-31 10:34:49 +02:00
|
|
|
gprintf(str);
|
2013-01-04 19:17:47 +01:00
|
|
|
|
2012-08-31 10:34:49 +02:00
|
|
|
}
|