
#ifndef REMOVE_MC_TEST

#include "ucps2.h"
//#include "SyncVer.h"
#include <Sliding.h>
#include <stdio.h>
#include <math.h>

#define DATA_SIZE 62464
#define CHUNK_SIZE 1024
#define WINDOW_SIZE 32  // 理想的窗口大小（前16，后15，加当前位置）


__DM1 int Input1[] = {
    #include <Inputdata1.dat>
};
__DM2 int Input2[] = {
    #include <Inputdata2.dat>
};
__DM3 int ConfigMatrix[] = {
    #include "ConfigSliding.dat"
};
__DM5 int MaxData[32];//bestposition maxsum

v16u32 KI = { 2, 4, 6 };
__DM3 v16s32 SVRReg  = {
    0, 0, 0, 0,
    0x40, 0, 0, 0,
    0xff00ff, 0, 0, 0x0000,
    0xffff, 0x6, 0, 0
};
int main(void) {
    int a;
    int is_synced = 0;  // 同步状态标志
    int maxPosition = 0;
    int maxsum = 0;

    // 初步同步：执行滑动相关性计算
    if (!is_synced) {
    	uint32_t time0 = tick();
        Sliding((int)ConfigMatrix, MPU_ADDR(Input1), MPU_ADDR(Input2), MPU_ADDR(MaxData));
        SVRReg[0] = MPU_ADDR(ConfigMatrix);
        SlidingAsm(SVRReg);
        a = __ucps2_getStatB();
        __ucps2_delay();
        int a = 0;
        for (int i = 0; i < 32; i++) {
        	printf("MaxData[%d] = %#010x\n", i, MaxData[i]);
        }
    }
    return 0;
}

#endif
