#include "CPB_Global.h"
#ifdef PC_SIM
#include <stdlib.h>
#endif

#ifndef PC_SIM
#pragma DATA_ALIGN(DefectData_CPB, 8);

TDefectData DefectData_CPB;

#pragma DATA_SECTION(InspectData, ".sdram")
TInspectData InspectData;
TTPBInspectionData InspectData_TPB;

#else
static int Initialized = 0;
unsigned char *CaptureImage_Buffer;
unsigned char *ResultImage_Buffer;
TDefectData DefectData_CPB;
#endif

int CPB_CORE_NUMBER;

#ifdef PC_SIM

void InitGlobal()
{
	int i;
	if (Initialized)
		return;
	CaptureImage_Buffer = new unsigned char[PROCESSING_WIDTH * PROCESSING_HEIGHT];
	ResultImage_Buffer = new unsigned char[PROCESSING_WIDTH * PROCESSING_HEIGHT];
	Initialized = 1;
}

void ExitGlobal()
{
	int i;
	if (!Initialized)
		return;
	delete[] CaptureImage_Buffer;
	delete[] ResultImage_Buffer;
	Initialized = 0;
}
#else

#endif
