/*******************************************************************************
 * Copyright (c) 2018 Renesas Electronics Corporation. All rights reserved.
 *
 * DESCRIPTION   : Log driver
 ******************************************************************************/

#include <stdarg.h>
#include <stdint.h>
#include <log.h>
#include <scif.h>

void local_printf(const char *fmt, ...)
{
	va_list ap;
	static char buffer[1024];
	int32_t num;
	uint32_t loop;

	va_start(ap, fmt);
	num = vsprintf(buffer, fmt, ap);
	va_end(ap);

	if (0 < num) {
		for (loop = 0; loop < num; loop++) {
			(void)console_putc(buffer[loop]);
			if (buffer[loop] == '\n') {
				(void)console_putc('\r');
			}
		}
	} else {
		panic();
	}
}

