/*
 * Copyright (c) 2012-2014 Wind River Systems, Inc.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <sys/printk.h>
#include <string.h>



#define LCD_WIDTH 368 // 368
#define LCD_HIGHT 448 // 448
#define LCD_MIDDLE                          184

__ALIGN(4)
uint8_t LCD_BUF[LCD_WIDTH * LCD_HIGHT * 2];

void main(void)
{
	printk("Hello World! %s\n", CONFIG_BOARD);

	while(1)
	{

		#ifdef CONFIG_NEWLIB_LIBC
			printk("new libc\r\n");
		#endif
		
		uint32_t timeStart=k_cycle_get_32();

		memset(LCD_BUF, 0, LCD_WIDTH * LCD_HIGHT * 2);		
		printk("memset  %u\r\n",k_cycle_get_32()-timeStart);
		timeStart=k_cycle_get_32();


		timeStart=k_cycle_get_32();
		memcpy(LCD_BUF,LCD_BUF+LCD_WIDTH * LCD_HIGHT,LCD_WIDTH * LCD_HIGHT);
		printk("memcpy  %u\r\n",k_cycle_get_32()-timeStart);

		k_msleep(1000);
	}
	
}
