添加功能
以原始数据运行CNN
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
|||||||
|
|
||||||
*.Qi
|
*.Qi
|
||||||
|
*.o
|
||||||
|
*.crf
|
||||||
|
|||||||
289
MY/cnn.c
289
MY/cnn.c
@@ -2,7 +2,15 @@
|
|||||||
|
|
||||||
u8 isrun;
|
u8 isrun;
|
||||||
|
|
||||||
|
void _cnn_run(){
|
||||||
|
isrun = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>*/
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD>*/
|
||||||
|
/// @brief <20><>ӡͼ<D3A1><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param array <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param array_num <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ܵĸ<DCB5><C4B8><EFBFBD>
|
||||||
|
/// @param elements_per_line ÿһ<C3BF>еĸ<D0B5><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
|
||||||
void PrintfArray(float *array, int array_num, int elements_per_line)
|
void PrintfArray(float *array, int array_num, int elements_per_line)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < array_num; i++)
|
for (int i = 0; i < array_num; i++)
|
||||||
@@ -22,17 +30,40 @@ void PrintfArray(float *array, int array_num, int elements_per_line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void PrintfResArray(float *array, int array_num, int elements_per_line)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < array_num; i++)
|
||||||
|
{
|
||||||
|
printf("%f ", array[i]); // <20><>ӡ<EFBFBD><D3A1>ǰԪ<C7B0><D4AA>
|
||||||
|
// ÿ<><C3BF>ӡ<EFBFBD><D3A1>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>غ<EFBFBD><D8BA><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
if ((i + 1) % elements_per_line == 0)
|
||||||
|
{
|
||||||
|
printf("\t");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*<2A><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>*/
|
/*<2A><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>*/
|
||||||
|
/// @brief <20><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD>飬<EFBFBD><E9A3AC><EFBFBD><EFBFBD>ΪelementSize
|
||||||
|
/// @param depth <20><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>a[depth][]
|
||||||
|
/// @param num <20><><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>a[][num]
|
||||||
|
/// @param elementSize <20><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
void **allocate2DArray(int depth, int num, size_t elementSize)
|
void **allocate2DArray(int depth, int num, size_t elementSize)
|
||||||
{
|
{
|
||||||
void **array = (void **)mymalloc(SRAMEX, depth * sizeof(void *));
|
void **array = (void **)mymalloc(SRAMEX, depth * sizeof(void *));
|
||||||
for (int d = 0; d < depth; d++)
|
for (int d = 0; d < depth; d++)
|
||||||
{
|
{
|
||||||
array[d] = mymalloc(SRAMEX, num * elementSize); // ÿ<><C3BF>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>չƽͼ<C6BD><CDBC>
|
array[d] = mymalloc(SRAMEX, num * elementSize);
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief <20>ͷ<EFBFBD>ͨ<EFBFBD><CDA8>allocate2DArray<61><79><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>
|
||||||
|
/// @param array <20><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>
|
||||||
|
/// @param depth <20><><EFBFBD><EFBFBD>
|
||||||
void free2DArray(float **array, int depth)
|
void free2DArray(float **array, int depth)
|
||||||
{
|
{
|
||||||
for (int d = 0; d < depth; d++)
|
for (int d = 0; d < depth; d++)
|
||||||
@@ -43,17 +74,19 @@ void free2DArray(float **array, int depth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD>*/
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>غ<EFBFBD><D8BA><EFBFBD>*/
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_size <20><><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>磺100<30><30>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>100<30><30>Ԫ<EFBFBD><D4AA>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void Full(float *inputArray, int input_size, float *outputArray)
|
void Full(float *inputArray, int input_size, float *outputArray)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i = 0; i < ((input_size + 2) * (input_size + 2)); i++)
|
for (i = 0; i < ((input_size + 2) * (input_size + 2)); i++)
|
||||||
{
|
{
|
||||||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
outputArray[i] = 0;
|
outputArray[i] = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < input_size; i++)
|
for (i = 0; i < input_size; i++)
|
||||||
{
|
{
|
||||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
for (j = 0; j < input_size; j++)
|
for (j = 0; j < input_size; j++)
|
||||||
{
|
{
|
||||||
outputArray[(i + 1) * (input_size + 2) + (j + 1)] = inputArray[i * input_size + j];
|
outputArray[(i + 1) * (input_size + 2) + (j + 1)] = inputArray[i * input_size + j];
|
||||||
@@ -61,6 +94,13 @@ void Full(float *inputArray, int input_size, float *outputArray)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>гػ<D0B3><D8BB><EFBFBD>ѡȡkernel_size*kernel_size<7A>ķ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊstep
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_size <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ĵ<EFBFBD><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param kernel_size <20>ػ<EFBFBD><D8BB>˵ĵ<CBB5><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param step <20><><EFBFBD><EFBFBD>ֵ
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void Pooling(float *inputArray, int input_size,
|
void Pooling(float *inputArray, int input_size,
|
||||||
int kernel_size, unsigned int step,
|
int kernel_size, unsigned int step,
|
||||||
float *outputArray)
|
float *outputArray)
|
||||||
@@ -94,6 +134,12 @@ void Pooling(float *inputArray, int input_size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>о<EFBFBD><D0BE><EFBFBD><EFBFBD><EFBFBD>ѡȡkernel_size*kernel_size<7A>ķ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD><EFBFBD>ﲽ<EFBFBD><EFB2BD>Ϊ1
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_size <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ĵ<EFBFBD><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param kernel <20><><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD>kernel_size * kernel_size<7A>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>˲<EFBFBD><CBB2><EFBFBD>
|
||||||
|
/// @param kernel_size <20>ػ<EFBFBD><D8BB>˵ĵ<CBB5><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void Convolution(float *inputArray, int input_size,
|
void Convolution(float *inputArray, int input_size,
|
||||||
float *kernel, int kernel_size,
|
float *kernel, int kernel_size,
|
||||||
float *outputArray)
|
float *outputArray)
|
||||||
@@ -125,6 +171,11 @@ void Convolution(float *inputArray, int input_size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief <20>Զ<EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧλ<D3A6><CEBB><EFBFBD><EFBFBD>
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_depth <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>a[input_depth][]
|
||||||
|
/// @param input_size <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ĵ<EFBFBD><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void Combine(float **inputArray, int input_depth, int input_size, float *outputArray)
|
void Combine(float **inputArray, int input_depth, int input_size, float *outputArray)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
@@ -147,6 +198,11 @@ void Combine(float **inputArray, int input_depth, int input_size, float *outputA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief չ<><D5B9><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һά<D2BB><CEAC><EFBFBD><EFBFBD>
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_depth <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD>a[input_depth][]
|
||||||
|
/// @param input_size <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ĵ<EFBFBD><C4B5>е<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void Flatten2D(float **inputArray, int input_depth, int input_size, float *outputArray)
|
void Flatten2D(float **inputArray, int input_depth, int input_size, float *outputArray)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
@@ -163,6 +219,11 @@ void Flatten2D(float **inputArray, int input_depth, int input_size, float *outpu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>ÿһλ<D2BB><CEBB><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_num <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ܵ<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param bias ƫ<>ú<EFBFBD>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
void AddBias(float *inputArray, int input_num, float bias, float *outputArray)
|
void AddBias(float *inputArray, int input_num, float bias, float *outputArray)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < input_num; i++)
|
for (int i = 0; i < input_num; i++)
|
||||||
@@ -171,6 +232,12 @@ void AddBias(float *inputArray, int input_num, float bias, float *outputArray)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief ȫ<><C8AB><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param input_num <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ܵ<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param input_w <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>غ<EFBFBD>
|
||||||
|
/// @param input_b <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD>ú<EFBFBD>
|
||||||
|
/// @return һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊfloat
|
||||||
float ConnectedLayer(float *inputArray, int input_num,
|
float ConnectedLayer(float *inputArray, int input_num,
|
||||||
float *input_w, float input_b)
|
float *input_w, float input_b)
|
||||||
{
|
{
|
||||||
@@ -184,6 +251,10 @@ float ConnectedLayer(float *inputArray, int input_num,
|
|||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief ReLU<4C><55><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD><EFBFBD>Ƕ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEA3BA>ֵ<EFBFBD><D6B5><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
||||||
|
/// @param inputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
/// @param num <20><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ܵ<EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param outputArray <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD>
|
||||||
void ReLU1(float *inputArray, int num, float *outputArray)
|
void ReLU1(float *inputArray, int num, float *outputArray)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < num; i++) {
|
for (int i = 0; i < num; i++) {
|
||||||
@@ -191,6 +262,9 @@ void ReLU1(float *inputArray, int num, float *outputArray)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief ReLU<4C><55><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD><EFBFBD>Ƕ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEA3BA>ֵ<EFBFBD><D6B5><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
||||||
|
/// @param data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @return <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊfloat
|
||||||
float ReLU2(float data)
|
float ReLU2(float data)
|
||||||
{
|
{
|
||||||
if (data > 0) {
|
if (data > 0) {
|
||||||
@@ -202,43 +276,94 @@ float ReLU2(float data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>ֵ
|
||||||
|
|
||||||
|
/// @brief <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ͱ<EFBFBD><EFBFBD><D7BC>
|
||||||
|
/// @param arr <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param size <20><><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
||||||
|
/// @param max_val <20><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||||
|
/// @param mean ƽ<><C6BD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||||
|
/// @param std_dev <20><><EFBFBD><EFBFBD><EEB1A3>
|
||||||
|
void calculate_statistics(float arr[], int size, float *max_val, float *mean, float *std_dev)
|
||||||
|
{
|
||||||
|
*max_val = fabs(arr[0]);
|
||||||
|
float sum = 0.0;
|
||||||
|
float sum_sq = 0.0;
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
float abs_val = fabs(arr[i]);
|
||||||
|
|
||||||
void generateMatrix(float *get_data, float Max_value, int totalPoints, float CNN_data[100][100])
|
if (abs_val > *max_val) {
|
||||||
|
*max_val = abs_val;
|
||||||
|
}
|
||||||
|
sum += abs_val;
|
||||||
|
sum_sq += abs_val * abs_val;
|
||||||
|
}
|
||||||
|
|
||||||
|
*mean = sum / size;
|
||||||
|
|
||||||
|
float variance = (sum_sq / size) - (*mean * *mean);
|
||||||
|
*std_dev = sqrt(variance);
|
||||||
|
}
|
||||||
|
//<2F>жϷŵ<CFB7>
|
||||||
|
|
||||||
|
/// @brief <20>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7>ŵ<EFBFBD>
|
||||||
|
/// @param arr <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param size <20><><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
||||||
|
/// @param mean ƽ<><C6BD>ֵ
|
||||||
|
/// @param std_dev <20><><EFBFBD><D7BC>
|
||||||
|
/// @return <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
||||||
|
int check_threshold(float arr[], int size, float *mean, float *std_dev)
|
||||||
|
{
|
||||||
|
const float threshold = 20.0;
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
float K = (arr[i] - *mean) / *std_dev;
|
||||||
|
if (K > threshold) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD>100*100<30><30><EFBFBD><EFBFBD>
|
||||||
|
/// @param get_data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param Max_value <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||||
|
/// @param totalPoints <20>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @param CNN_data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飨<EFBFBD><E9A3A8>ά<EFBFBD><CEAC>
|
||||||
|
void generateMatrix(float *get_data, float Max_value, int totalPoints, float CNN_data[100*100])
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < 100; i++) {
|
||||||
for (int j = 0; j < 100; j++) {
|
for (int j = 0; j < 100; j++) {
|
||||||
CNN_data[i][j] = 0;
|
CNN_data[i*100+j] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int pointsPerInterval = totalPoints / 100;
|
int pointsPerInterval = totalPoints / 100;
|
||||||
float amplitudeStep = Max_value / 100;
|
float amplitudeStep = Max_value / 100;
|
||||||
// long float amplitudeStep = Max_value / 100;
|
|
||||||
|
|
||||||
for (int i = 0; i < totalPoints; i++) {
|
for (int i = 0; i < totalPoints; i++) {
|
||||||
|
float amplitudeValue = fabsf(get_data[i]);
|
||||||
|
|
||||||
float amplitudeValue = fabs(get_data[i]);//data[n][] = 0.000696*n ~ 0.000696*(n+1)
|
if (amplitudeValue == 0.0f) {
|
||||||
// long float amplitudeValue = fabs(get_data[i]);//data[n][] = 0.000696*n ~ 0.000696*(n+1)
|
continue;
|
||||||
|
|
||||||
if (amplitudeValue > Max_value) {
|
|
||||||
amplitudeValue = Max_value;
|
|
||||||
} else if (amplitudeValue < 0) {
|
|
||||||
amplitudeValue = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int intervalIndex = i / pointsPerInterval;
|
int intervalIndex = i / pointsPerInterval;
|
||||||
if (intervalIndex >= 100) intervalIndex = 99;
|
if (intervalIndex >= 100) intervalIndex = 99;
|
||||||
|
|
||||||
int amplitudeIndex = (int)(amplitudeValue / amplitudeStep);
|
int amplitudeIndex = 99 - (int)(amplitudeValue / amplitudeStep);
|
||||||
if (amplitudeIndex >= 100) amplitudeIndex = 99;
|
if (amplitudeIndex < 0) amplitudeIndex = 0;
|
||||||
|
|
||||||
CNN_data[amplitudeIndex][intervalIndex]++;
|
CNN_data[amplitudeIndex*100+intervalIndex]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param input_array <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param output_array <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/// @param input_num <20><><EFBFBD><EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
||||||
|
/// @return <20><><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>+1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>a[0]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31>
|
||||||
int calculate_probabilities(float *input_array, float *output_array, int input_num)
|
int calculate_probabilities(float *input_array, float *output_array, int input_num)
|
||||||
{
|
{
|
||||||
float sum = 0.0;
|
float sum = 0.0;
|
||||||
@@ -266,12 +391,25 @@ int calculate_probabilities(float *input_array, float *output_array, int input_n
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void _cnn_run(){
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD><C7BB><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ż<EFBFBD>*/
|
||||||
isrun = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/*ԭʼ<D4AD><CABC><EFBFBD>ݸ<EFBFBD><DDB8><EFBFBD>
|
||||||
|
*Ŀǰ<C4BF><C7B0><EFBFBD><EFBFBD>֤<EFBFBD>ܷ<EFBFBD><DCB7><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>㣬<EFBFBD>п<EFBFBD><D0BF>ܳ<EFBFBD><DCB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*Ŀǰû<C7B0><C3BB><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>Ԫ<EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>㡣
|
||||||
|
*ԭʼ<D4AD><CABC><EFBFBD>ݸ<EFBFBD><DDB8><EFBFBD><EFBFBD><EFBFBD>ӡ<EFBFBD><D3A1>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>㣬<EFBFBD><E3A3AC><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// @brief <20><><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
||||||
|
/// @param data <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һά<D2BB><CEAC><EFBFBD><EFBFBD>ԭʼ<D4AD><CABC><EFBFBD><EFBFBD> --> data.array<61><79><EFBFBD><EFBFBD>
|
||||||
|
/// @param size ԭʼ<D4AD><CABC><EFBFBD>ݸ<EFBFBD><DDB8><EFBFBD> --> data.maxlength<74><68><EFBFBD><EFBFBD>
|
||||||
|
void cnn_run()
|
||||||
|
{
|
||||||
|
float maxvalue = 0.0; //<2F><><EFBFBD><EFBFBD>ֵ
|
||||||
|
float meanvalue = 0.0; //ƽ<><C6BD>ֵ
|
||||||
|
float std_devvalue = 0.0; //<2F><><EFBFBD><D7BC>
|
||||||
|
int index = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>ɶ<EFBFBD>ģ<EFBFBD>
|
||||||
|
float *Matrix_data = (float*)mymalloc(SRAMEX, sizeof(float) * 100 * 100); //<2F><><EFBFBD>ɵ<EFBFBD>100*100<30>ľ<EFBFBD><C4BE><EFBFBD><F3B1A3B4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
void cnn_run(){
|
|
||||||
printf("CNNģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\nData<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>Ϊ<EFBFBD><EFBFBD>%s\r\n",data.dname);
|
printf("CNNģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\nData<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>Ϊ<EFBFBD><EFBFBD>%s\r\n",data.dname);
|
||||||
DEBUG_PRINTF("data[%d]: %f\r\n",0,data.array[0]);
|
DEBUG_PRINTF("data[%d]: %f\r\n",0,data.array[0]);
|
||||||
DEBUG_PRINTF("data[%d]: %f\r\n",1,data.array[1]);
|
DEBUG_PRINTF("data[%d]: %f\r\n",1,data.array[1]);
|
||||||
@@ -279,14 +417,39 @@ void cnn_run(){
|
|||||||
DEBUG_PRINTF("data[%d]: %f\r\n",299,data.array[299]);
|
DEBUG_PRINTF("data[%d]: %f\r\n",299,data.array[299]);
|
||||||
DEBUG_PRINTF("data[%d]: %f\r\n",300,data.array[300]);
|
DEBUG_PRINTF("data[%d]: %f\r\n",300,data.array[300]);
|
||||||
DEBUG_PRINTF("data[%d]: %f\r\n",301,data.array[301]);
|
DEBUG_PRINTF("data[%d]: %f\r\n",301,data.array[301]);
|
||||||
|
DEBUG_PRINTF("data[%d]: %f\r\n",1249997,data.array[1249997]);
|
||||||
|
DEBUG_PRINTF("data[%d]: %f\r\n",1249998,data.array[1249998]);
|
||||||
|
DEBUG_PRINTF("data[%d]: %f\r\n",1249999,data.array[1249999]);
|
||||||
|
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
|
calculate_statistics(data.array, data.maxlength, &maxvalue, &meanvalue,&std_devvalue);
|
||||||
|
|
||||||
|
/*<2A>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<C7B7><F1B3ACB9><EFBFBD>ֵ*/
|
||||||
|
int x = check_threshold(data.array, data.maxlength, &meanvalue, &std_devvalue);
|
||||||
|
if (x == 1) {
|
||||||
|
printf("Start\r\n");
|
||||||
|
//pre <20><>ʼԤ<CABC><D4A4><EFBFBD><EFBFBD>
|
||||||
|
/*<2A><><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>*/
|
||||||
|
generateMatrix(data.array, maxvalue, data.maxlength, Matrix_data);
|
||||||
|
float *CNN_data = (float*)mymalloc(SRAMEX, sizeof(float) * 100 * 100);
|
||||||
|
/*<2A><>ά<EFBFBD><CEAC><EFBFBD><EFBFBD>תһά<D2BB><CEAC><EFBFBD>飬<EFBFBD>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
for (int j = 0; j < 100; j++) {
|
||||||
|
CNN_data[9999 - index++] = Matrix_data[i*100+j];
|
||||||
|
}
|
||||||
|
}
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>һ<EFBFBD>㣡\r\n");
|
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>һ<EFBFBD>㣡\r\n");
|
||||||
//1
|
//1 <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>*/
|
||||||
float* Full_output1 = (float*)mymalloc(SRAMEX, sizeof(float) * 102 * 102);
|
float* Full_output1 = (float*)mymalloc(SRAMEX, sizeof(float) * 102 * 102);
|
||||||
Full(data.array, 100, Full_output1);
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
|
Full(CNN_data, 100, Full_output1);
|
||||||
float** Convolution_result1_before = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
float** Convolution_result1_before = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
||||||
float** Convolution_result1_relu = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
float** Convolution_result1_relu = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
||||||
float** Convolution_result1 = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
float** Convolution_result1 = (float**)allocate2DArray(32, 100 * 100, sizeof(float));
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
|
/*<2A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD>û<EFBFBD>Ż<EFBFBD><C5BB><EFBFBD>*/
|
||||||
float conv1_weight_new[9] = {
|
float conv1_weight_new[9] = {
|
||||||
conv1_weight.array[i*9+0],conv1_weight.array[i*9+1],
|
conv1_weight.array[i*9+0],conv1_weight.array[i*9+1],
|
||||||
conv1_weight.array[i*9+2],conv1_weight.array[i*9+3],
|
conv1_weight.array[i*9+2],conv1_weight.array[i*9+3],
|
||||||
@@ -295,32 +458,40 @@ void cnn_run(){
|
|||||||
conv1_weight.array[i*9+8] };
|
conv1_weight.array[i*9+8] };
|
||||||
Convolution(Full_output1, 102, conv1_weight_new, 3, Convolution_result1_before[i]);
|
Convolution(Full_output1, 102, conv1_weight_new, 3, Convolution_result1_before[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>*/
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
AddBias(Convolution_result1_before[i], 100 * 100, conv1_bias.array[i], Convolution_result1_relu[i]);
|
AddBias(Convolution_result1_before[i], 100 * 100, conv1_bias.array[i], Convolution_result1_relu[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><>ReLU<4C><55><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
ReLU1(Convolution_result1_relu[i], 100 * 100, Convolution_result1[i]);
|
ReLU1(Convolution_result1_relu[i], 100 * 100, Convolution_result1[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float ** Pooling_result1 = (float**)allocate2DArray(32, 50 * 50, sizeof(float));
|
float ** Pooling_result1 = (float**)allocate2DArray(32, 50 * 50, sizeof(float));
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
Pooling(Convolution_result1[i], 100, 2, 2, Pooling_result1[i]);
|
Pooling(Convolution_result1[i], 100, 2, 2, Pooling_result1[i]);
|
||||||
}
|
}
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
DEBUG_PRINTF("<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
||||||
//2
|
//2 <20>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
/*<2A>ͷ<EFBFBD><CDB7><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ*/
|
||||||
myfree(SRAMEX, Full_output1);
|
myfree(SRAMEX, Full_output1);
|
||||||
free2DArray(Convolution_result1_relu,32);
|
free2DArray(Convolution_result1_relu,32);
|
||||||
free2DArray(Convolution_result1_before,32);
|
free2DArray(Convolution_result1_before,32);
|
||||||
free2DArray(Convolution_result1,32);
|
free2DArray(Convolution_result1,32);
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float** Full_output2 = (float**)allocate2DArray(32, 52 * 52, sizeof(float));
|
float** Full_output2 = (float**)allocate2DArray(32, 52 * 52, sizeof(float));
|
||||||
for (int i = 0; i < 32; i++) {
|
for (int i = 0; i < 32; i++) {
|
||||||
Full(Pooling_result1[i], 50, Full_output2[i]);
|
Full(Pooling_result1[i], 50, Full_output2[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD>뱾<EFBFBD><EBB1BE><EFBFBD><EFBFBD>Դ*/
|
||||||
float** Convolution_result_temp_2 = (float**)allocate2DArray(32, 50 * 50, sizeof(float));
|
float** Convolution_result_temp_2 = (float**)allocate2DArray(32, 50 * 50, sizeof(float));
|
||||||
float** Convolution_result2_before = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
float** Convolution_result2_before = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
||||||
float** Convolution_result2_relu = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
float** Convolution_result2_relu = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
||||||
float** Convolution_result2 = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
float** Convolution_result2 = (float**)allocate2DArray(64, 50 * 50, sizeof(float));
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 64; i++) {
|
for (int i = 0; i < 64; i++) {
|
||||||
for (int j = 0; j < 32; j++) {
|
for (int j = 0; j < 32; j++) {
|
||||||
|
/*<2A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float conv2_weight_new[9] = {
|
float conv2_weight_new[9] = {
|
||||||
conv2_weight.array[i*32*9+9*j+0],conv2_weight.array[i*32*9+9*j+1],
|
conv2_weight.array[i*32*9+9*j+0],conv2_weight.array[i*32*9+9*j+1],
|
||||||
conv2_weight.array[i*32*9+9*j+2],conv2_weight.array[i*32*9+9*j+3],
|
conv2_weight.array[i*32*9+9*j+2],conv2_weight.array[i*32*9+9*j+3],
|
||||||
@@ -330,34 +501,42 @@ void cnn_run(){
|
|||||||
};
|
};
|
||||||
Convolution(Full_output2[j], 52, conv2_weight_new, 3, Convolution_result_temp_2[j]);
|
Convolution(Full_output2[j], 52, conv2_weight_new, 3, Convolution_result_temp_2[j]);
|
||||||
}
|
}
|
||||||
|
/*ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ϲ<EFBFBD>*/
|
||||||
Combine(Convolution_result_temp_2, 32, 50, Convolution_result2_before[i]);
|
Combine(Convolution_result_temp_2, 32, 50, Convolution_result2_before[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>*/
|
||||||
for (int i = 0; i < 64; i++) {
|
for (int i = 0; i < 64; i++) {
|
||||||
AddBias(Convolution_result2_before[i], 50 * 50, conv2_bias.array[i], Convolution_result2_relu[i]);
|
AddBias(Convolution_result2_before[i], 50 * 50, conv2_bias.array[i], Convolution_result2_relu[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD><EFBFBD>ReLU<4C><55><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 64; i++) {
|
for (int i = 0; i < 64; i++) {
|
||||||
ReLU1(Convolution_result2_relu[i], 50 * 50, Convolution_result2[i]);
|
ReLU1(Convolution_result2_relu[i], 50 * 50, Convolution_result2[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float** Pooling_result2 = (float**)allocate2DArray(64, 25 * 25, sizeof(float));
|
float** Pooling_result2 = (float**)allocate2DArray(64, 25 * 25, sizeof(float));
|
||||||
for (int i = 0; i < 64; i++) {
|
for (int i = 0; i < 64; i++) {
|
||||||
Pooling(Convolution_result2[i], 50, 2, 2, Pooling_result2[i]);
|
Pooling(Convolution_result2[i], 50, 2, 2, Pooling_result2[i]);
|
||||||
}
|
}
|
||||||
DEBUG_PRINTF("<EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
DEBUG_PRINTF("<EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
||||||
//3
|
//3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
myfree(SRAMEX, Full_output2);
|
/*<2A>ͷ<EFBFBD><CDB7><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ*/
|
||||||
|
free2DArray(Full_output2,32);
|
||||||
free2DArray(Pooling_result1,32);
|
free2DArray(Pooling_result1,32);
|
||||||
free2DArray(Convolution_result_temp_2,32);
|
free2DArray(Convolution_result_temp_2,32);
|
||||||
free2DArray(Convolution_result2_relu,64);
|
free2DArray(Convolution_result2_relu,64);
|
||||||
free2DArray(Convolution_result2_before,64);
|
free2DArray(Convolution_result2_before,64);
|
||||||
free2DArray(Convolution_result2,64);
|
free2DArray(Convolution_result2,64);
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float** Full_output3 = (float**)allocate2DArray(64, 27 * 27, sizeof(float));
|
float** Full_output3 = (float**)allocate2DArray(64, 27 * 27, sizeof(float));
|
||||||
for (int i = 0; i < 64; i++) {
|
for (int i = 0; i < 64; i++) {
|
||||||
Full(Pooling_result2[i], 25, Full_output3[i]);
|
Full(Pooling_result2[i], 25, Full_output3[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD>뱾<EFBFBD><EBB1BE><EFBFBD><EFBFBD>Դ*/
|
||||||
float** Convolution_result_temp_3 = (float**)allocate2DArray(64, 25 * 25, sizeof(float));
|
float** Convolution_result_temp_3 = (float**)allocate2DArray(64, 25 * 25, sizeof(float));
|
||||||
float** Convolution_result3_before = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
float** Convolution_result3_before = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
||||||
float** Convolution_result3_relu = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
float** Convolution_result3_relu = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
||||||
float** Convolution_result3 = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
float** Convolution_result3 = (float**)allocate2DArray(128, 25 * 25, sizeof(float));
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < 128; i++) {
|
||||||
for (int j = 0; j < 64; j++) {
|
for (int j = 0; j < 64; j++) {
|
||||||
float conv3_weight_new[9] = {
|
float conv3_weight_new[9] = {
|
||||||
@@ -369,66 +548,84 @@ void cnn_run(){
|
|||||||
};
|
};
|
||||||
Convolution(Full_output3[j], 27, conv3_weight_new, 3, Convolution_result_temp_3[j]);
|
Convolution(Full_output3[j], 27, conv3_weight_new, 3, Convolution_result_temp_3[j]);
|
||||||
}
|
}
|
||||||
|
/*<2A><>ͼ<EFBFBD><CDBC><EFBFBD>ϲ<EFBFBD>*/
|
||||||
Combine(Convolution_result_temp_3, 64, 25, Convolution_result3_before[i]);
|
Combine(Convolution_result_temp_3, 64, 25, Convolution_result3_before[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A><><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>*/
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < 128; i++) {
|
||||||
AddBias(Convolution_result3_before[i], 25 * 25, conv3_bias.array[i], Convolution_result3_relu[i]);
|
AddBias(Convolution_result3_before[i], 25 * 25, conv3_bias.array[i], Convolution_result3_relu[i]);
|
||||||
}
|
}
|
||||||
|
/*ReLU<4C><55><EFBFBD><EFBFBD>*/
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < 128; i++) {
|
||||||
ReLU1(Convolution_result3_relu[i], 25 * 25, Convolution_result3[i]);
|
ReLU1(Convolution_result3_relu[i], 25 * 25, Convolution_result3[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
float** Pooling_result3 = (float**)allocate2DArray(128, 12 * 12, sizeof(float));
|
float** Pooling_result3 = (float**)allocate2DArray(128, 12 * 12, sizeof(float));
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < 128; i++) {
|
||||||
Pooling(Convolution_result3_before[i], 25, 2, 2, Pooling_result3[i]);
|
Pooling(Convolution_result3_before[i], 25, 2, 2, Pooling_result3[i]);
|
||||||
}
|
}
|
||||||
|
/*<2A>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD>һά<D2BB><CEAC><EFBFBD><EFBFBD>*/
|
||||||
float* xi = (float *)mymalloc(SRAMEX, sizeof(float) * 128 * 12 * 12);
|
float* xi = (float *)mymalloc(SRAMEX, sizeof(float) * 128 * 12 * 12);
|
||||||
Flatten2D(Pooling_result3, 128, 12, xi);
|
Flatten2D(Pooling_result3, 128, 12, xi);
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
||||||
//4
|
//4 <20><>һ<EFBFBD><D2BB><EFBFBD>Ӳ<EFBFBD>
|
||||||
myfree(SRAMEX, Full_output3);
|
/*<2A>ͷ<EFBFBD><CDB7><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ*/
|
||||||
|
free2DArray(Full_output3,64);
|
||||||
free2DArray(Pooling_result2,64);
|
free2DArray(Pooling_result2,64);
|
||||||
free2DArray(Convolution_result_temp_3,64);
|
free2DArray(Convolution_result_temp_3,64);
|
||||||
free2DArray(Convolution_result3_relu,128);
|
free2DArray(Convolution_result3_relu,128);
|
||||||
free2DArray(Convolution_result3_before,128);
|
free2DArray(Convolution_result3_before,128);
|
||||||
free2DArray(Convolution_result3,128);
|
free2DArray(Convolution_result3,128);
|
||||||
|
/*<2A><><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
//float yi[128] = {0};
|
//float yi[128] = {0};
|
||||||
|
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>IJ㣡\r\n");
|
||||||
float* yi = (float *)mymalloc(SRAMEX, 128 * sizeof(float));
|
float* yi = (float *)mymalloc(SRAMEX, 128 * sizeof(float));
|
||||||
memset(yi, 0, 128 * sizeof(float));
|
memset(yi, 0, 128 * sizeof(float));
|
||||||
|
|
||||||
for (int i = 0; i < 128; i++) {
|
for (int i = 0; i < 128; i++) {
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
|
//float fc1_weight_new[128*12*12];
|
||||||
float* fc1_weight_new = (float*)mymalloc(SRAMEX, sizeof(float) * 128 * 12 * 12);
|
float* fc1_weight_new = (float*)mymalloc(SRAMEX, sizeof(float) * 128 * 12 * 12);
|
||||||
|
/*<2A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
memcpy(fc1_weight_new,&fc1_weight.array[i*128*12*12],128*12*12 * sizeof(float));
|
memcpy(fc1_weight_new,&fc1_weight.array[i*128*12*12],128*12*12 * sizeof(float));
|
||||||
sum = ConnectedLayer(xi, 128 * 12 * 12, fc1_weight_new, fc1_bias.array[i]);
|
sum = ConnectedLayer(xi, 128 * 12 * 12, fc1_weight_new, fc1_bias.array[i]);
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ReLU<4C><55><EFBFBD><EFBFBD>*/
|
||||||
yi[i] = ReLU2(sum);
|
yi[i] = ReLU2(sum);
|
||||||
myfree(SRAMEX, fc1_weight_new);
|
myfree(SRAMEX, fc1_weight_new);
|
||||||
}
|
}
|
||||||
//printf("\n");
|
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
||||||
//PrintfArray(yi,128,128);
|
//5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӳ<EFBFBD>
|
||||||
//5
|
/*<2A>ͷ<EFBFBD><CDB7><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ*/
|
||||||
free2DArray(Pooling_result3,128);
|
free2DArray(Pooling_result3,128);
|
||||||
|
/*<2A><><EFBFBD>Ӳ<EFBFBD><D3B2><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
//float zi[7] = { 0 };
|
float zi[7] = {0};
|
||||||
float *zi = (float *)mymalloc(SRAMEX, 7 * sizeof(float));
|
// float *zi = (float *)mymalloc(SRAMEX, 7 * sizeof(float));
|
||||||
memset(yi, 0, 7 * sizeof(float));
|
// memset(zi, 0, 7 * sizeof(float));
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++) {
|
for (int i = 0; i < 7; i++) {
|
||||||
float fc2_weight_new[128];
|
//float fc2_weight_new[128];
|
||||||
|
float* fc2_weight_new = (float*)mymalloc(SRAMEX, sizeof(float) * 128);
|
||||||
|
/*<2A><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||||
memcpy(fc2_weight_new,&fc2_weight.array[i*128],128 * sizeof(float));
|
memcpy(fc2_weight_new,&fc2_weight.array[i*128],128 * sizeof(float));
|
||||||
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ReLU<4C><55><EFBFBD><EFBFBD>*/
|
||||||
zi[i] = ConnectedLayer(yi, 128, fc2_weight_new, fc2_bias.array[i]);
|
zi[i] = ConnectedLayer(yi, 128, fc2_weight_new, fc2_bias.array[i]);
|
||||||
|
myfree(SRAMEX, fc2_weight_new);
|
||||||
}
|
}
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD>\r\n");
|
||||||
PrintfArray(zi,7,7);
|
//end <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
//end
|
float result[7];
|
||||||
float *result = (float *)mymalloc(SRAMEX, 7 * sizeof(float));
|
|
||||||
int max_probability_idx = calculate_probabilities(zi,result,7);
|
int max_probability_idx = calculate_probabilities(zi,result,7);
|
||||||
PrintfArray(result,7,7);
|
PrintfResArray(zi,7,7);
|
||||||
printf("%f, Label %d\r\n", result[max_probability_idx - 1] * 100, max_probability_idx);
|
PrintfResArray(result,7,7);
|
||||||
|
printf("%f, Label %d\t", result[max_probability_idx - 1] * 100, max_probability_idx);
|
||||||
myfree(SRAMEX, xi);
|
myfree(SRAMEX, xi);
|
||||||
myfree(SRAMEX, yi);
|
myfree(SRAMEX, yi);
|
||||||
myfree(SRAMEX, zi);
|
myfree(SRAMEX, CNN_data);
|
||||||
myfree(SRAMEX, result);
|
myfree(SRAMEX, Full_output1);
|
||||||
|
myfree(SRAMEX, Matrix_data);
|
||||||
|
}
|
||||||
|
else printf("No\r\n");/*<2A><><EFBFBD><EFBFBD>û<EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD>ӡ<EFBFBD><D3A1>No<4E><6F>*/
|
||||||
|
printf("maxvalue is:%f\t",maxvalue);
|
||||||
|
printf("meanvalue is:%f\t",meanvalue);
|
||||||
|
printf("std_devvalue is:%f\r\n",std_devvalue);
|
||||||
isrun = 0;
|
isrun = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
MY/cnn.h
8
MY/cnn.h
@@ -1,6 +1,9 @@
|
|||||||
#ifndef _CNN_H_
|
#ifndef _CNN_H_
|
||||||
#define _CNN_H_
|
#define _CNN_H_
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "my.h"
|
#include "my.h"
|
||||||
|
|
||||||
@@ -20,9 +23,12 @@ float ReLU2(float data);
|
|||||||
void AddBias(float *inputArray, int input_num, float bias, float *outputArray);
|
void AddBias(float *inputArray, int input_num, float bias, float *outputArray);
|
||||||
|
|
||||||
int calculate_probabilities(float *input_array, float *output_array, int input_num);
|
int calculate_probabilities(float *input_array, float *output_array, int input_num);
|
||||||
void generateMatrix(float *get_data, float Max_value, int totalPoints, float CNN_data[100][100]);
|
void generateMatrix(float *get_data, float Max_value, int totalPoints, float CNN_data[100*100]);
|
||||||
|
void calculate_statistics(float arr[], int size, float *max_val, float *mean, float *std_dev);
|
||||||
|
int check_threshold(float arr[], int size, float *mean, float *std_dev);
|
||||||
|
|
||||||
void _cnn_run(void);
|
void _cnn_run(void);
|
||||||
void cnn_run(void);
|
void cnn_run(void);
|
||||||
|
void PrintfResArray(float *array, int array_num, int elements_per_line);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
|
|
||||||
u8 _DEBUG = 1;
|
u8 _DEBUG = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
68
MY/my.c
68
MY/my.c
@@ -156,12 +156,12 @@ u8 model_write(char* model_name)
|
|||||||
model_write("fc1_weight");
|
model_write("fc1_weight");
|
||||||
model_write("fc2_bias");
|
model_write("fc2_bias");
|
||||||
model_write("fc2_weight");
|
model_write("fc2_weight");
|
||||||
model_write("data");
|
|
||||||
|
|
||||||
model_info("all");
|
model_info("all");
|
||||||
SDRAM_USED();
|
SDRAM_USED();
|
||||||
}else{
|
}else{
|
||||||
u8 res=0;
|
u8 res=0;
|
||||||
|
u8 isneg=0;
|
||||||
u8 _times=0;
|
u8 _times=0;
|
||||||
u32 _larr = 0;
|
u32 _larr = 0;
|
||||||
u8 _len = strlen(model_name);
|
u8 _len = strlen(model_name);
|
||||||
@@ -171,11 +171,10 @@ u8 model_write(char* model_name)
|
|||||||
int progress;
|
int progress;
|
||||||
Model *_model = model(model_name);
|
Model *_model = model(model_name);
|
||||||
|
|
||||||
printf("\r\n");
|
|
||||||
if(_model == NULL || strcmp(model_name, "data") == 0){
|
if(_model == NULL || strcmp(model_name, "data") == 0){
|
||||||
sprintf(_path, "0:/%s.txt", model_name);
|
sprintf(_path, "0:/%s.txt", model_name);
|
||||||
if(f_open(file, (const TCHAR *)_path, 1)){
|
if(f_open(file, (const TCHAR *)_path, 1)){
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>ģ<EFBFBD>ͻ<EFBFBD>Data<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
|
DEBUG_PRINTF("\r\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>ģ<EFBFBD>ͻ<EFBFBD>Data<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
|
||||||
return 199;
|
return 199;
|
||||||
}else{
|
}else{
|
||||||
_model = model("data");
|
_model = model("data");
|
||||||
@@ -199,8 +198,8 @@ u8 model_write(char* model_name)
|
|||||||
DEBUG_PRINTF("д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>%s\r\n", _model -> name);
|
DEBUG_PRINTF("д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>%s\r\n", _model -> name);
|
||||||
if(_model -> dname)DEBUG_PRINTF("д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Data<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD>ǣ<EFBFBD>%s\r\n", _model -> dname);
|
if(_model -> dname)DEBUG_PRINTF("д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Data<EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD><EFBFBD>ǣ<EFBFBD>%s\r\n", _model -> dname);
|
||||||
DEBUG_PRINTF("д<EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%d\r\n", _model -> maxlength);
|
DEBUG_PRINTF("д<EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%d\r\n", _model -> maxlength);
|
||||||
DEBUG_PRINTF("Ŀǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%d\r\n", _model -> realength);
|
DEBUG_PRINTF("Ŀǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>%d", _model -> realength);
|
||||||
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD>'%s'<27><><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>......\r\n",_model -> dname ? _model -> dname : _model -> name);
|
printf("\r\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ģ<EFBFBD>Ͳ<EFBFBD><EFBFBD><EFBFBD>'%s'<27><><EFBFBD><EFBFBD><EFBFBD>Ժ<EFBFBD>......\r\n",_model -> dname ? _model -> dname : _model -> name);
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
res = f_read(file, fatbuf, READLENGTH ,&br);
|
res = f_read(file, fatbuf, READLENGTH ,&br);
|
||||||
@@ -211,13 +210,17 @@ u8 model_write(char* model_name)
|
|||||||
for(int i=0; i < br; i++){
|
for(int i=0; i < br; i++){
|
||||||
if(fatbuf[i] == 0x0d){
|
if(fatbuf[i] == 0x0d){
|
||||||
float _fvalue = atof(_fstr);
|
float _fvalue = atof(_fstr);
|
||||||
|
if(isneg)_fvalue = -_fvalue;
|
||||||
_model -> array[_larr++] = _fvalue;
|
_model -> array[_larr++] = _fvalue;
|
||||||
//DEBUG_PRINTF("<22>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[string]: %s\r\n<>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[float]: %f\r\n",i,_fstr,_fvalue);
|
//DEBUG_PRINTF("<22>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[string]: %s\r\n<>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[float]: %f\r\n",i,_fstr,_fvalue);
|
||||||
i++;
|
i++;
|
||||||
|
isneg=0;
|
||||||
*_fstr = NULL;
|
*_fstr = NULL;
|
||||||
_model -> realength = _larr; //_larr<72><72><EFBFBD><EFBFBD>ֵΪģ<CEAA><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
_model -> realength = _larr; //_larr<72><72><EFBFBD><EFBFBD>ֵΪģ<CEAA><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
if(_larr >= _model -> maxlength)break;
|
if(_larr >= _model -> maxlength)break;
|
||||||
}else{
|
}
|
||||||
|
else if(fatbuf[i] == 0x2d)isneg = 1;
|
||||||
|
else{
|
||||||
sprintf(_sstr, "%c", fatbuf[i]);
|
sprintf(_sstr, "%c", fatbuf[i]);
|
||||||
strcat(_fstr, _sstr);
|
strcat(_fstr, _sstr);
|
||||||
//DEBUG_PRINTF("[%d]_fstr is[%s], _sstr is[%s], fatbuf is [%c]\r\n",i,_fstr,_sstr,fatbuf[i]);
|
//DEBUG_PRINTF("[%d]_fstr is[%s], _sstr is[%s], fatbuf is [%c]\r\n",i,_fstr,_sstr,fatbuf[i]);
|
||||||
@@ -225,12 +228,12 @@ u8 model_write(char* model_name)
|
|||||||
}
|
}
|
||||||
if(_model -> maxlength >= 73728 && (_larr >= (_model -> maxlength/10)*_times)){
|
if(_model -> maxlength >= 73728 && (_larr >= (_model -> maxlength/10)*_times)){
|
||||||
progress = _larr >= _model -> maxlength ? 100 : _times++ == 0 ? 0 : progress + 10;
|
progress = _larr >= _model -> maxlength ? 100 : _times++ == 0 ? 0 : progress + 10;
|
||||||
printf("\r\n[");
|
DEBUG_PRINTF("\r\n[");
|
||||||
for(u16 j=0; j<50;j++){
|
for(u16 j=0; j<50;j++){
|
||||||
if(j < progress/2) printf("=");
|
if(j < progress/2) DEBUG_PRINTF("=");
|
||||||
else printf(" ");
|
else DEBUG_PRINTF(" ");
|
||||||
}
|
}
|
||||||
printf("] %d%%", progress);
|
DEBUG_PRINTF("] %d%%", progress);
|
||||||
}
|
}
|
||||||
if(_larr >= _model -> maxlength)break;
|
if(_larr >= _model -> maxlength)break;
|
||||||
}
|
}
|
||||||
@@ -388,48 +391,3 @@ void model_init(){
|
|||||||
data.dname = "data";
|
data.dname = "data";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
u8 sd_read(u32 length, char* model_name, u32 gap)
|
|
||||||
{
|
|
||||||
u8 res=0;
|
|
||||||
u32 _larr = 0;
|
|
||||||
char _tmp[11] = "";
|
|
||||||
char _path[20] = {0};
|
|
||||||
|
|
||||||
float* floatArray = NULL;
|
|
||||||
Model *_model = model(model_name);
|
|
||||||
|
|
||||||
if(length >= _model -> maxlength)length = _model -> maxlength -1;
|
|
||||||
floatArray = modelmym_init(model_name);
|
|
||||||
if(floatArray == NULL){
|
|
||||||
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
sprintf(_path, "0:/%s.txt",model_name);
|
|
||||||
f_open(file,(const TCHAR*)_path,1);//<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|
||||||
while(_larr <= length){
|
|
||||||
res=f_read(file,fatbuf,11,&br);
|
|
||||||
if(res)DEBUG_PRINTF("\r\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:%d\r\n",res);
|
|
||||||
else{
|
|
||||||
for(u32 i=0;i<br;i++){
|
|
||||||
if(fatbuf[i]==0x0d){
|
|
||||||
float value = atof(_tmp);
|
|
||||||
memset(_tmp, 0, sizeof(_tmp));
|
|
||||||
floatArray[_larr++] = value;
|
|
||||||
DEBUG_PRINTF("<EFBFBD>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[string]: %s\r\n",i,_tmp);
|
|
||||||
DEBUG_PRINTF("<EFBFBD>س<EFBFBD>[%d] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[float]: %f\r\n",i+1,value);
|
|
||||||
}else{
|
|
||||||
char buffer[2];
|
|
||||||
sprintf(buffer, "%c", fatbuf[i]);
|
|
||||||
strcat(_tmp, buffer);
|
|
||||||
DEBUG_PRINTF("[%d]: %c\r\n",i,fatbuf[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i=0;i<((length/gap)+(length%gap ? 2 : 1));i++)
|
|
||||||
printf("\r\nfloatArray[%d]: %f",i<=length ? i : length,i<=length ? floatArray[i] : floatArray[length]);
|
|
||||||
printf("\r\n");
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|||||||
2
MY/my.h
2
MY/my.h
@@ -36,7 +36,7 @@ typedef struct {
|
|||||||
#define FC1_WEIGHT_ARRSIZE 128*18432 //2359296
|
#define FC1_WEIGHT_ARRSIZE 128*18432 //2359296
|
||||||
#define FC2_BIAS_ARRSIZE 7
|
#define FC2_BIAS_ARRSIZE 7
|
||||||
#define FC2_WEIGHT_ARRSIZE 7*128 //896
|
#define FC2_WEIGHT_ARRSIZE 7*128 //896
|
||||||
#define DATA_ARRSIZE 100*100 //10000
|
#define DATA_ARRSIZE 1250000 //1250000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
OBJ/FATFS.axf
BIN
OBJ/FATFS.axf
Binary file not shown.
@@ -21,15 +21,67 @@ Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V2.0.18.0
|
|||||||
Dialog DLL: TCM.DLL V1.14.14.0
|
Dialog DLL: TCM.DLL V1.14.14.0
|
||||||
|
|
||||||
<h2>Project:</h2>
|
<h2>Project:</h2>
|
||||||
D:\Desktop\ʵ<><CAB5>41 FATFSʵ<53><CAB5>\USER\FATFS.uvprojx
|
D:\local-rep\stm32-cnn\USER\FATFS.uvprojx
|
||||||
Project File Date: 10/27/2024
|
Project File Date: 11/07/2024
|
||||||
|
|
||||||
<h2>Output:</h2>
|
<h2>Output:</h2>
|
||||||
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
|
*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
|
||||||
Build target 'FATFS'
|
Rebuild target 'FATFS'
|
||||||
|
assembling startup_stm32f429xx.s...
|
||||||
|
compiling stm32f4xx_hal_pwr.c...
|
||||||
|
compiling stm32f4xx_hal_dma_ex.c...
|
||||||
|
compiling stm32f4xx_hal.c...
|
||||||
|
compiling stm32f4xx_hal_dma.c...
|
||||||
|
compiling system_stm32f4xx.c...
|
||||||
|
compiling stm32f4xx_hal_tim_ex.c...
|
||||||
|
compiling stm32f4xx_hal_cortex.c...
|
||||||
|
compiling stm32f4xx_hal_rcc.c...
|
||||||
|
compiling stm32f4xx_hal_uart.c...
|
||||||
|
compiling stm32f4xx_hal_rcc_ex.c...
|
||||||
|
compiling main.c...
|
||||||
|
compiling stm32f4xx_hal_gpio.c...
|
||||||
|
compiling stm32f4xx_it.c...
|
||||||
|
compiling stm32f4xx_hal_pwr_ex.c...
|
||||||
|
compiling stm32f4xx_hal_usart.c...
|
||||||
|
compiling stm32f4xx_hal_tim.c...
|
||||||
|
compiling stm32f4xx_hal_spi.c...
|
||||||
|
compiling stm32f4xx_hal_sd.c...
|
||||||
|
compiling stm32f4xx_hal_dma2d.c...
|
||||||
|
compiling led.c...
|
||||||
|
compiling stm32f4xx_ll_sdmmc.c...
|
||||||
|
compiling stm32f4xx_hal_ltdc_ex.c...
|
||||||
|
compiling sys.c...
|
||||||
|
compiling stm32f4xx_hal_sdram.c...
|
||||||
|
compiling stm32f4xx_hal_sram.c...
|
||||||
|
compiling key.c...
|
||||||
|
compiling usart.c...
|
||||||
|
compiling stm32f4xx_hal_nand.c...
|
||||||
|
compiling stm32f4xx_hal_ltdc.c...
|
||||||
|
compiling stm32f4xx_ll_fmc.c...
|
||||||
|
compiling delay.c...
|
||||||
|
compiling lcd.c...
|
||||||
|
compiling cc936.c...
|
||||||
|
compiling ff.c...
|
||||||
|
compiling sdram.c...
|
||||||
|
compiling usmart.c...
|
||||||
|
compiling spi.c...
|
||||||
|
compiling diskio.c...
|
||||||
|
compiling w25qxx.c...
|
||||||
|
compiling usmart_str.c...
|
||||||
|
compiling ltdc.c...
|
||||||
|
compiling fattester.c...
|
||||||
|
compiling exfuns.c...
|
||||||
|
compiling nand.c...
|
||||||
|
compiling nandtester.c...
|
||||||
|
compiling sdio_sdcard.c...
|
||||||
|
compiling ftl.c...
|
||||||
|
compiling usmart_config.c...
|
||||||
|
compiling malloc.c...
|
||||||
|
compiling my.c...
|
||||||
|
compiling debug.c...
|
||||||
compiling cnn.c...
|
compiling cnn.c...
|
||||||
linking...
|
linking...
|
||||||
Program Size: Code=69272 RO-data=195672 RW-data=796 ZI-data=33751548
|
Program Size: Code=53718 RO-data=176794 RW-data=672 ZI-data=33751256
|
||||||
FromELF: creating hex file...
|
FromELF: creating hex file...
|
||||||
"..\OBJ\FATFS.axf" - 0 Error(s), 0 Warning(s).
|
"..\OBJ\FATFS.axf" - 0 Error(s), 0 Warning(s).
|
||||||
|
|
||||||
@@ -45,7 +97,7 @@ Package Vendor: Keil
|
|||||||
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
||||||
|
|
||||||
<h2>Collection of Component Files used:</h2>
|
<h2>Collection of Component Files used:</h2>
|
||||||
Build Time Elapsed: 00:00:02
|
Build Time Elapsed: 00:00:09
|
||||||
</pre>
|
</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
30918
OBJ/FATFS.hex
30918
OBJ/FATFS.hex
File diff suppressed because it is too large
Load Diff
4957
OBJ/FATFS.htm
4957
OBJ/FATFS.htm
File diff suppressed because it is too large
Load Diff
3188
OBJ/FATFS.map
3188
OBJ/FATFS.map
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
Dependencies for Project 'FATFS', Target 'FATFS': (DO NOT MODIFY !)
|
Dependencies for Project 'FATFS', Target 'FATFS': (DO NOT MODIFY !)
|
||||||
CompilerVersion: 5060300::V5.06 update 3 (build 300)::ARMCC
|
CompilerVersion: 5060300::V5.06 update 3 (build 300)::ARMCC
|
||||||
F (.\main.c)(0x671F364E)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
F (.\main.c)(0x672DDA02)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
||||||
|
|
||||||
-I.\RTE\_FATFS
|
-I.\RTE\_FATFS
|
||||||
|
|
||||||
@@ -75,9 +75,6 @@ I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hcd.h)(0x57764068)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
||||||
@@ -90,11 +87,12 @@ I (..\USMART\usmart.h)(0x57764068)
|
|||||||
I (..\HARDWARE\LED\led.h)(0x57764068)
|
I (..\HARDWARE\LED\led.h)(0x57764068)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x574E3E26)
|
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x574E3E26)
|
||||||
I (..\HARDWARE\SDRAM\sdram.h)(0x577640E8)
|
I (..\HARDWARE\SDRAM\sdram.h)(0x577640E8)
|
||||||
I (..\MALLOC\malloc.h)(0x671E40F9)
|
I (..\MALLOC\malloc.h)(0x671E40F9)
|
||||||
I (..\HARDWARE\W25QXX\w25qxx.h)(0x57764068)
|
I (..\HARDWARE\W25QXX\w25qxx.h)(0x57764068)
|
||||||
I (..\FATFS\src\ff.h)(0x577640E7)
|
I (..\FATFS\src\ff.h)(0x577640E7)
|
||||||
I (..\FATFS\src\integer.h)(0x577640E7)
|
I (..\FATFS\src\integer.h)(0x577640E7)
|
||||||
I (..\FATFS\src\ffconf.h)(0x577640E7)
|
I (..\FATFS\src\ffconf.h)(0x577640E7)
|
||||||
|
I (..\FATFS\exfuns\exfuns.h)(0x577640E7)
|
||||||
I (..\USMART\usmart.h)(0x57764068)
|
I (..\USMART\usmart.h)(0x57764068)
|
||||||
I (..\USMART\usmart_str.h)(0x57764068)
|
I (..\USMART\usmart_str.h)(0x57764068)
|
||||||
I (..\HARDWARE\SDIO\sdio_sdcard.h)(0x577640E7)
|
I (..\HARDWARE\SDIO\sdio_sdcard.h)(0x577640E7)
|
||||||
@@ -2926,7 +2924,7 @@ I (..\HARDWARE\NAND\ftl.h)(0x577640E7)
|
|||||||
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x66E967A3)
|
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x66E967A3)
|
||||||
I (..\CORE\core_cmInstr.h)(0x57764068)
|
I (..\CORE\core_cmInstr.h)(0x57764068)
|
||||||
I (..\CORE\cmsis_armcc.h)(0x57764068)
|
I (..\CORE\cmsis_armcc.h)(0x57764068)
|
||||||
I (..\CORE\core_cmFunc.h)(0x57764068)
|
I (..\CORE\core_cmFunc.h)(0x57764068)
|
||||||
I (..\CORE\core_cmSimd.h)(0x57764068)
|
I (..\CORE\core_cmSimd.h)(0x57764068)
|
||||||
I (..\USER\system_stm32f4xx.h)(0x57764069)
|
I (..\USER\system_stm32f4xx.h)(0x57764069)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h)(0x57764068)
|
||||||
@@ -3078,7 +3076,7 @@ I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h)(0x57764068)
|
|||||||
I (..\SYSTEM\usart\usart.h)(0x577640E8)
|
I (..\SYSTEM\usart\usart.h)(0x577640E8)
|
||||||
F (..\HARDWARE\NAND\ftl.c)(0x577640E7)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
F (..\HARDWARE\NAND\ftl.c)(0x577640E7)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
||||||
|
|
||||||
-I.\RTE\_FATFS
|
-I.\RTE\_FATFS
|
||||||
|
|
||||||
-IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
-IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
||||||
|
|
||||||
@@ -3161,7 +3159,7 @@ I (..\FATFS\src\ffconf.h)(0x577640E7)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hcd.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hcd.h)(0x57764068)
|
||||||
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x574E3E26)
|
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x574E3E26)
|
||||||
I (..\MALLOC\malloc.h)(0x671E40F9)
|
I (..\MALLOC\malloc.h)(0x671E40F9)
|
||||||
I (..\HARDWARE\NAND\nand.h)(0x5B0F9EBE)
|
I (..\HARDWARE\NAND\nand.h)(0x5B0F9EBE)
|
||||||
I (..\SYSTEM\usart\usart.h)(0x577640E8)
|
I (..\SYSTEM\usart\usart.h)(0x577640E8)
|
||||||
F (..\HARDWARE\NAND\nand.c)(0x5B0F9F61)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
F (..\HARDWARE\NAND\nand.c)(0x5B0F9F61)(-c --cpu Cortex-M4.fp.sp -D__MICROLIB -g -O2 --apcs=interwork --split_sections -I ..\CORE -I ..\OBJ -I ..\USER -I ..\HALLIB\STM32F4xx_HAL_Driver\Inc -I ..\SYSTEM\delay -I ..\SYSTEM\sys -I ..\SYSTEM\usart -I ..\HARDWARE\LED -I ..\HARDWARE\KEY -I ..\HARDWARE\LCD -I ..\HARDWARE\SDRAM -I ..\HARDWARE\KEY -I ..\HARDWARE\SDIO -I ..\HARDWARE\SPI -I ..\HARDWARE\W25QXX -I ..\HARDWARE\NAND -I ..\MALLOC -I ..\USMART -I ..\FATFS\exfuns -I ..\FATFS\src -I ..\MY
|
||||||
|
|
||||||
@@ -3170,7 +3168,7 @@ I (..\MY\debug.h)(0x671A30FA)
|
|||||||
-IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
-IC:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.9.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include
|
||||||
|
|
||||||
-IC:\Keil_v5\ARM\CMSIS\Include
|
-IC:\Keil_v5\ARM\CMSIS\Include
|
||||||
|
|
||||||
-D__UVISION_VERSION="529" -DSTM32F429xx -DUSE_HAL_DRIVER -DSTM32F429xx --C99
|
-D__UVISION_VERSION="529" -DSTM32F429xx -DUSE_HAL_DRIVER -DSTM32F429xx --C99
|
||||||
|
|
||||||
-o ..\obj\nand.o --omf_browse ..\obj\nand.crf --depend ..\obj\nand.d)
|
-o ..\obj\nand.o --omf_browse ..\obj\nand.crf --depend ..\obj\nand.d)
|
||||||
@@ -3415,7 +3413,7 @@ I (..\FATFS\src\ffconf.h)(0x577640E7)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usb.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hcd.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hcd.h)(0x57764068)
|
||||||
@@ -3498,9 +3496,8 @@ I (..\SYSTEM\usart\usart.h)(0x577640E8)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
||||||
@@ -3586,7 +3583,7 @@ I (..\MY\debug.h)(0x671A30FA)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_smartcard.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_wwdg.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pcd.h)(0x57764068)
|
||||||
@@ -3664,10 +3661,13 @@ I (C:\Keil_v5\ARM\ARMCC\include\stdlib.h)(0x574E3E26)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_sram.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_sram.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_fmc.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_fmc.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_nor.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_nor.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pccard.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_nand.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_sdram.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pccard.h)(0x57764068)
|
||||||
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_sdram.h)(0x57764068)
|
||||||
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_hash.h)(0x57764068)
|
||||||
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2s.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2s_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2s_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_iwdg.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_iwdg.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_ltdc.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_ltdc.h)(0x57764068)
|
||||||
@@ -3684,7 +3684,6 @@ I (..\USER\stm32f4xx_hal_conf.h)(0x57764069)
|
|||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h)(0x57764068)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_usart.h)(0x57764068)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_irda.h)(0x57764068)
|
||||||
@@ -3751,5 +3750,3 @@ I (..\FATFS\exfuns\exfuns.h)(0x577640E7)
|
|||||||
I (..\USER\system_stm32f4xx.h)(0x57764069)
|
I (..\USER\system_stm32f4xx.h)(0x57764069)
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h)(0x57764068)
|
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h)(0x57764068)
|
||||||
I (..\USER\stm32f4xx_hal_conf.h)(0x57764069)
|
I (..\USER\stm32f4xx_hal_conf.h)(0x57764069)
|
||||||
I (..\USER\stm32f4xx_hal_conf.h)(0x57764069)
|
|
||||||
I (..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h)(0x57764068)
|
|
||||||
|
|||||||
BIN
OBJ/cc936.o
BIN
OBJ/cc936.o
Binary file not shown.
BIN
OBJ/cnn.crf
BIN
OBJ/cnn.crf
Binary file not shown.
@@ -1,5 +1,8 @@
|
|||||||
..\obj\cnn.o: ..\MY\cnn.c
|
..\obj\cnn.o: ..\MY\cnn.c
|
||||||
..\obj\cnn.o: ..\MY\cnn.h
|
..\obj\cnn.o: ..\MY\cnn.h
|
||||||
|
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
||||||
|
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
|
||||||
|
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
..\obj\cnn.o: ..\MY\my.h
|
..\obj\cnn.o: ..\MY\my.h
|
||||||
..\obj\cnn.o: ..\FATFS\exfuns\fattester.h
|
..\obj\cnn.o: ..\FATFS\exfuns\fattester.h
|
||||||
@@ -19,7 +22,6 @@
|
|||||||
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h
|
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h
|
||||||
..\obj\cnn.o: ..\USER\stm32f4xx.h
|
..\obj\cnn.o: ..\USER\stm32f4xx.h
|
||||||
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\Legacy/stm32_hal_legacy.h
|
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\Legacy/stm32_hal_legacy.h
|
||||||
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
|
|
||||||
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h
|
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h
|
||||||
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h
|
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h
|
||||||
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h
|
..\obj\cnn.o: ..\HALLIB\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h
|
||||||
@@ -86,5 +88,3 @@
|
|||||||
..\obj\cnn.o: ..\MALLOC\malloc.h
|
..\obj\cnn.o: ..\MALLOC\malloc.h
|
||||||
..\obj\cnn.o: ..\MY\debug.h
|
..\obj\cnn.o: ..\MY\debug.h
|
||||||
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h
|
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h
|
||||||
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
|
||||||
..\obj\cnn.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
|
||||||
|
|||||||
BIN
OBJ/debug.crf
BIN
OBJ/debug.crf
Binary file not shown.
BIN
OBJ/debug.o
BIN
OBJ/debug.o
Binary file not shown.
BIN
OBJ/delay.o
BIN
OBJ/delay.o
Binary file not shown.
BIN
OBJ/diskio.o
BIN
OBJ/diskio.o
Binary file not shown.
BIN
OBJ/exfuns.o
BIN
OBJ/exfuns.o
Binary file not shown.
Binary file not shown.
BIN
OBJ/fattester.o
BIN
OBJ/fattester.o
Binary file not shown.
BIN
OBJ/ltdc.o
BIN
OBJ/ltdc.o
Binary file not shown.
BIN
OBJ/main.crf
BIN
OBJ/main.crf
Binary file not shown.
@@ -74,9 +74,6 @@
|
|||||||
..\obj\main.o: ..\SYSTEM\delay\delay.h
|
..\obj\main.o: ..\SYSTEM\delay\delay.h
|
||||||
..\obj\main.o: ..\SYSTEM\usart\usart.h
|
..\obj\main.o: ..\SYSTEM\usart\usart.h
|
||||||
..\obj\main.o: ..\HARDWARE\LED\led.h
|
..\obj\main.o: ..\HARDWARE\LED\led.h
|
||||||
..\obj\main.o: ..\HARDWARE\KEY\key.h
|
|
||||||
..\obj\main.o: ..\HARDWARE\LCD\lcd.h
|
|
||||||
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
|
||||||
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
|
||||||
..\obj\main.o: ..\HARDWARE\SDRAM\sdram.h
|
..\obj\main.o: ..\HARDWARE\SDRAM\sdram.h
|
||||||
..\obj\main.o: ..\MALLOC\malloc.h
|
..\obj\main.o: ..\MALLOC\malloc.h
|
||||||
@@ -93,6 +90,7 @@
|
|||||||
..\obj\main.o: ..\FATFS\exfuns\fattester.h
|
..\obj\main.o: ..\FATFS\exfuns\fattester.h
|
||||||
..\obj\main.o: ..\MY\debug.h
|
..\obj\main.o: ..\MY\debug.h
|
||||||
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h
|
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h
|
||||||
|
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h
|
||||||
..\obj\main.o: ..\MY\debug.h
|
..\obj\main.o: ..\MY\debug.h
|
||||||
..\obj\main.o: ..\MY\cnn.h
|
..\obj\main.o: ..\MY\cnn.h
|
||||||
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
..\obj\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h
|
||||||
|
|||||||
BIN
OBJ/main.o
BIN
OBJ/main.o
Binary file not shown.
BIN
OBJ/malloc.crf
BIN
OBJ/malloc.crf
Binary file not shown.
BIN
OBJ/malloc.o
BIN
OBJ/malloc.o
Binary file not shown.
BIN
OBJ/my.crf
BIN
OBJ/my.crf
Binary file not shown.
BIN
OBJ/nand.o
BIN
OBJ/nand.o
Binary file not shown.
BIN
OBJ/nandtester.o
BIN
OBJ/nandtester.o
Binary file not shown.
Binary file not shown.
BIN
OBJ/sdram.o
BIN
OBJ/sdram.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
OBJ/usart.o
BIN
OBJ/usart.o
Binary file not shown.
BIN
OBJ/usmart.o
BIN
OBJ/usmart.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
OBJ/usmart_str.o
BIN
OBJ/usmart_str.o
Binary file not shown.
BIN
OBJ/w25qxx.o
BIN
OBJ/w25qxx.o
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -148,78 +148,38 @@
|
|||||||
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F429IGTx$CMSIS\Flash\STM32F4xx_1024.FLM))</Name>
|
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F429IGTx$CMSIS\Flash\STM32F4xx_1024.FLM))</Name>
|
||||||
</SetRegEntry>
|
</SetRegEntry>
|
||||||
</TargetDriverDllRegistry>
|
</TargetDriverDllRegistry>
|
||||||
<Breakpoint>
|
<Breakpoint/>
|
||||||
<Bp>
|
|
||||||
<Number>0</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>280</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>134278690</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>1</BreakIfRCount>
|
|
||||||
<Filename>D:\Desktop\瀹為獙41 FATFS瀹為獙\MY\my.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression>\\FATFS\../MY/my.c\280</Expression>
|
|
||||||
</Bp>
|
|
||||||
<Bp>
|
|
||||||
<Number>1</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>206</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>134279282</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>1</BreakIfRCount>
|
|
||||||
<Filename>D:\Desktop\瀹為獙41 FATFS瀹為獙\MY\my.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression>\\FATFS\../MY/my.c\206</Expression>
|
|
||||||
</Bp>
|
|
||||||
<Bp>
|
|
||||||
<Number>2</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>207</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>0</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>0</BreakIfRCount>
|
|
||||||
<Filename>..\MY\my.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression></Expression>
|
|
||||||
</Bp>
|
|
||||||
<Bp>
|
|
||||||
<Number>3</Number>
|
|
||||||
<Type>0</Type>
|
|
||||||
<LineNumber>283</LineNumber>
|
|
||||||
<EnabledFlag>1</EnabledFlag>
|
|
||||||
<Address>0</Address>
|
|
||||||
<ByteObject>0</ByteObject>
|
|
||||||
<HtxType>0</HtxType>
|
|
||||||
<ManyObjects>0</ManyObjects>
|
|
||||||
<SizeOfObject>0</SizeOfObject>
|
|
||||||
<BreakByAccess>0</BreakByAccess>
|
|
||||||
<BreakIfRCount>0</BreakIfRCount>
|
|
||||||
<Filename>..\MY\my.c</Filename>
|
|
||||||
<ExecCommand></ExecCommand>
|
|
||||||
<Expression></Expression>
|
|
||||||
</Bp>
|
|
||||||
</Breakpoint>
|
|
||||||
<WatchWindow2>
|
<WatchWindow2>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>0</count>
|
<count>0</count>
|
||||||
<WinNumber>2</WinNumber>
|
<WinNumber>2</WinNumber>
|
||||||
<ItemText>data</ItemText>
|
<ItemText>data</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>1</count>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<ItemText>fatbuf[i]</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>2</count>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<ItemText>isneg</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>3</count>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<ItemText>i</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>4</count>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<ItemText>totalPoints</ItemText>
|
||||||
|
</Ww>
|
||||||
|
<Ww>
|
||||||
|
<count>5</count>
|
||||||
|
<WinNumber>2</WinNumber>
|
||||||
|
<ItemText>i</ItemText>
|
||||||
|
</Ww>
|
||||||
</WatchWindow2>
|
</WatchWindow2>
|
||||||
<MemoryWindow1>
|
<MemoryWindow1>
|
||||||
<Mm>
|
<Mm>
|
||||||
@@ -260,7 +220,7 @@
|
|||||||
<aLa>0</aLa>
|
<aLa>0</aLa>
|
||||||
<aPa1>0</aPa1>
|
<aPa1>0</aPa1>
|
||||||
<AscS4>0</AscS4>
|
<AscS4>0</AscS4>
|
||||||
<aSer4>1</aSer4>
|
<aSer4>0</aSer4>
|
||||||
<StkLoc>0</StkLoc>
|
<StkLoc>0</StkLoc>
|
||||||
<TrcWin>0</TrcWin>
|
<TrcWin>0</TrcWin>
|
||||||
<newCpu>0</newCpu>
|
<newCpu>0</newCpu>
|
||||||
@@ -1014,7 +974,7 @@
|
|||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>README</GroupName>
|
<GroupName>MY</GroupName>
|
||||||
<tvExp>1</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
@@ -1022,26 +982,6 @@
|
|||||||
<File>
|
<File>
|
||||||
<GroupNumber>9</GroupNumber>
|
<GroupNumber>9</GroupNumber>
|
||||||
<FileNumber>56</FileNumber>
|
<FileNumber>56</FileNumber>
|
||||||
<FileType>5</FileType>
|
|
||||||
<tvExp>0</tvExp>
|
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
|
||||||
<bDave2>0</bDave2>
|
|
||||||
<PathWithFileName>..\readme.txt</PathWithFileName>
|
|
||||||
<FilenameWithoutPath>readme.txt</FilenameWithoutPath>
|
|
||||||
<RteFlg>0</RteFlg>
|
|
||||||
<bShared>0</bShared>
|
|
||||||
</File>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Group>
|
|
||||||
<GroupName>MY</GroupName>
|
|
||||||
<tvExp>1</tvExp>
|
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
|
||||||
<cbSel>0</cbSel>
|
|
||||||
<RteFlg>0</RteFlg>
|
|
||||||
<File>
|
|
||||||
<GroupNumber>10</GroupNumber>
|
|
||||||
<FileNumber>57</FileNumber>
|
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
@@ -1052,8 +992,8 @@
|
|||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>10</GroupNumber>
|
<GroupNumber>9</GroupNumber>
|
||||||
<FileNumber>58</FileNumber>
|
<FileNumber>57</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
@@ -1064,8 +1004,8 @@
|
|||||||
<bShared>0</bShared>
|
<bShared>0</bShared>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<GroupNumber>10</GroupNumber>
|
<GroupNumber>9</GroupNumber>
|
||||||
<FileNumber>59</FileNumber>
|
<FileNumber>58</FileNumber>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>0</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
|
|||||||
@@ -694,16 +694,6 @@
|
|||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
|
||||||
<GroupName>README</GroupName>
|
|
||||||
<Files>
|
|
||||||
<File>
|
|
||||||
<FileName>readme.txt</FileName>
|
|
||||||
<FileType>5</FileType>
|
|
||||||
<FilePath>..\readme.txt</FilePath>
|
|
||||||
</File>
|
|
||||||
</Files>
|
|
||||||
</Group>
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>MY</GroupName>
|
<GroupName>MY</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
|
|||||||
176
USER/main.c
176
USER/main.c
@@ -2,8 +2,6 @@
|
|||||||
#include "delay.h"
|
#include "delay.h"
|
||||||
#include "usart.h"
|
#include "usart.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "key.h"
|
|
||||||
#include "lcd.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "sdram.h"
|
#include "sdram.h"
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
@@ -17,116 +15,118 @@
|
|||||||
#include "my.h"
|
#include "my.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "cnn.h"
|
#include "cnn.h"
|
||||||
/************************************************
|
|
||||||
ALIENTEK <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>STM32F429<32><39><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>41
|
|
||||||
FATFSʵ<53><CAB5>-HAL<41>⺯<EFBFBD><E2BAAF><EFBFBD><EFBFBD>
|
|
||||||
<20><><EFBFBD><EFBFBD>֧<EFBFBD>֣<EFBFBD>www.openedv.com
|
|
||||||
<20>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>̣<EFBFBD>http://eboard.taobao.com
|
|
||||||
<20><>ע<D7A2>Ź<EFBFBD><C5B9><EFBFBD>ƽ̨<CCA8>źţ<C5BA>"<22><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>"<22><><EFBFBD><EFBFBD><EFBFBD>ѻ<EFBFBD>ȡSTM32<33><32><EFBFBD>ϡ<EFBFBD>
|
|
||||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<D3BF><C6BC><EFBFBD><EFBFBD><EFBFBD>˾
|
|
||||||
<20><><EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD> @ALIENTEK
|
|
||||||
************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
u32 total,free;
|
u32 total,free;
|
||||||
u8 key;
|
|
||||||
|
|
||||||
HAL_Init(); //<2F><>ʼ<EFBFBD><CABC>HAL<41><4C>
|
HAL_Init();
|
||||||
Stm32_Clock_Init(360,25,2,8); //<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,180Mhz
|
Stm32_Clock_Init(360,25,2,8);
|
||||||
delay_init(180); //<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
delay_init(180);
|
||||||
uart_init(9600); //<2F><>ʼ<EFBFBD><CABC>USART
|
uart_init(9600);
|
||||||
|
|
||||||
LED_Init(); //<2F><>ʼ<EFBFBD><CABC>LED
|
SDRAM_Init();
|
||||||
KEY_Init(); //<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
LED_Init();
|
||||||
SDRAM_Init(); //SDRAM<41><4D>ʼ<EFBFBD><CABC>
|
my_mem_init(SRAMIN);
|
||||||
LCD_Init(); //LCD<43><44>ʼ<EFBFBD><CABC>
|
my_mem_init(SRAMEX);
|
||||||
my_mem_init(SRAMEX); //<2F><>ʼ<EFBFBD><CABC><EFBFBD>ⲿ<EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>
|
|
||||||
|
|
||||||
model_init(); //ģ<>Ͳ<EFBFBD><CDB2><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
|
model_init();
|
||||||
TIM3_Init(5000-1,9000-1); //<2F><>ʱ<EFBFBD><CAB1>3<EFBFBD><33>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʱ<EFBFBD><CAB1>Ϊ90M<30><4D><EFBFBD><EFBFBD>Ƶϵ<C6B5><CFB5>Ϊ9000-1
|
TIM3_Init(5000-1,9000-1); //定时器3初始化,定时器时钟为90M,分频系数为9000-1
|
||||||
//////////////////////////////<EFBFBD><EFBFBD><EFBFBD>Թ<EFBFBD><EFBFBD><EFBFBD>usmart<EFBFBD>ij<EFBFBD>ʼ<EFBFBD><EFBFBD>/////////////////////////////////
|
//////////////////////////////调试工具usmart的初始化/////////////////////////////////
|
||||||
usmart_dev.init(90);
|
usmart_dev.init(90);
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
POINT_COLOR=RED;
|
u8 _res_sd = SD_Init();
|
||||||
LCD_ShowString(30,50,200,16,16,"Apollo STM32F4/F7");
|
if(_res_sd)printf("SD Card Error!\r\n");
|
||||||
while(SD_Init())//<2F><><EFBFBD>ⲻ<EFBFBD><E2B2BB>SD<53><44>
|
while(_res_sd)//检测不到SD卡
|
||||||
{
|
{
|
||||||
LCD_ShowString(30,150,200,16,16,"SD Card Error!");
|
|
||||||
delay_ms(500);
|
delay_ms(500);
|
||||||
LCD_ShowString(30,150,200,16,16,"Please Check! ");
|
LED0=!LED0;
|
||||||
delay_ms(500);
|
|
||||||
LED0=!LED0;//DS0<53><30>˸
|
|
||||||
}
|
}
|
||||||
FTL_Init();
|
FTL_Init();
|
||||||
exfuns_init(); //Ϊfatfs<EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
exfuns_init(); //为fatfs相关变量申请内存
|
||||||
f_mount(fs[0],"0:",1); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD>SD<EFBFBD><EFBFBD>
|
f_mount(fs[0],"0:",1); //挂载SD卡
|
||||||
fatbuf=(u8*)mymalloc(SRAMEX,512); //Ϊfatbuf<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>
|
fatbuf=(u8*)mymalloc(SRAMEX,512); //为fatbuf申请内存
|
||||||
LCD_Fill(30,150,240,150+16,WHITE); //<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
_res_sd = exf_getfree("0:",&total,&free); //得到SD卡的总容量和剩余容量
|
||||||
while(exf_getfree("0:",&total,&free)) //<2F>õ<EFBFBD>SD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
if(_res_sd)printf("SD Card Fatfs Error!");
|
||||||
|
while(_res_sd)
|
||||||
{
|
{
|
||||||
LCD_ShowString(30,150,200,16,16,"SD Card Fatfs Error!");
|
delay_ms(100);
|
||||||
delay_ms(200);
|
LED0=!LED0;
|
||||||
LCD_Fill(30,150,240,150+16,WHITE); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
||||||
delay_ms(200);
|
|
||||||
LED0=!LED0;//DS0<53><30>˸
|
|
||||||
}
|
}
|
||||||
POINT_COLOR=BLUE;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ɫ
|
|
||||||
LCD_ShowString(30,150,200,16,16,"FATFS OK!");
|
|
||||||
LCD_ShowString(30,170,200,16,16,"SD Total Size: MB");
|
|
||||||
LCD_ShowString(30,190,200,16,16,"SD Free Size: MB");
|
|
||||||
LCD_ShowNum(30+8*14,170,total>>10,5,16); //<2F><>ʾSD<53><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MB
|
|
||||||
LCD_ShowNum(30+8*14,190,free>>10,5,16); //<2F><>ʾSD<53><44>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MB
|
|
||||||
|
|
||||||
model_write("all");
|
model_write("all");
|
||||||
printf("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>\r\n");
|
printf("初始化完成!\r\n");
|
||||||
|
|
||||||
|
// char* modelusearr[] = {
|
||||||
|
// "C1autosave00095_right_new_2",
|
||||||
|
// "C1autosave00096_right_new_2",
|
||||||
|
// "C1autosave00097_right_new_2",
|
||||||
|
// "C1autosave00098_right_new_2",
|
||||||
|
// "C1autosave00099_right_new_2",
|
||||||
|
// "C1autosave00100_right_new_2",
|
||||||
|
// "C1autosave00101_right_new_2",
|
||||||
|
// "C1autosave00102_right_new_2",
|
||||||
|
// "C1autosave00103_right_new_2",
|
||||||
|
// "C1autosave00104_right_new_2",
|
||||||
|
// "C1autosave00105_right_new_2",
|
||||||
|
// "C1autosave00106_right_new_2",
|
||||||
|
// "C1autosave00107_right_new_2",
|
||||||
|
// "C1autosave00108_right_new_2",
|
||||||
|
// "C1autosave00109_right_new_2",
|
||||||
|
// "C1autosave00110_right_new_2",
|
||||||
|
// "C1autosave00111_right_new_2",
|
||||||
|
// "C1autosave00112_right_new_2",
|
||||||
|
// "C1autosave00113_right_new_2",
|
||||||
|
// "C1autosave00114_right_new_2",
|
||||||
|
// "C1autosave00115_right_new_2",
|
||||||
|
// "C1autosave00116_right_new_2",
|
||||||
|
// "C1autosave00117_right_new_2",
|
||||||
|
// "C1autosave00118_right_new_2",
|
||||||
|
// "C1autosave00119_right_new_2",
|
||||||
|
// "C1autosave00120_right_new_2",
|
||||||
|
// "C1autosave00121_right_new_2",
|
||||||
|
// "C1autosave00122_right_new_2",
|
||||||
|
// "C1autosave00123_right_new_2",
|
||||||
|
// "C1autosave00124_right_new_2",
|
||||||
|
|
||||||
|
// "filtered_C1autosave00011_right_new",
|
||||||
|
// "filtered_C1autosave00015_right_new",
|
||||||
|
// "filtered_C1autosave00043_right_new",
|
||||||
|
// "filtered_C1autosave00067_right_new",
|
||||||
|
// "filtered_C1autosave00090_right_new",
|
||||||
|
// "filtered_C1autosave00106_right_new",
|
||||||
|
// "filtered_C1autosave00118_right_new",
|
||||||
|
|
||||||
|
// "filtered_C1autosave00007_right_new",
|
||||||
|
// "filtered_C1autosave00035_right_new",
|
||||||
|
// "filtered_C1autosave00036_right_new",
|
||||||
|
// "filtered_C1autosave00040_right_new",
|
||||||
|
// "filtered_C1autosave00053_right_new",
|
||||||
|
// "filtered_C1autosave00061_right_new",
|
||||||
|
// "filtered_C1autosave00074_right_new",
|
||||||
|
// "filtered_C1autosave00077_right_new",
|
||||||
|
// "filtered_C1autosave00080_right_new",
|
||||||
|
// "filtered_C1autosave00085_right_new",
|
||||||
|
// "filtered_C1autosave00098_right_new",
|
||||||
|
// "filtered_C1autosave00100_right_new",
|
||||||
|
// "filtered_C1autosave00104_right_new",
|
||||||
|
// "filtered_C1autosave00122_right_new",
|
||||||
|
// "filtered_C1autosave00124_right_new",
|
||||||
|
|
||||||
|
// "filtered_C1autosave00108_right_new",
|
||||||
|
|
||||||
|
// "filtered_C1autosave00004_right_new",
|
||||||
char* modelusearr[] = {
|
// "filtered_C1autosave00039_right_new",
|
||||||
|
// "filtered_C1autosave00062_right_new",
|
||||||
"filtered_C1autosave00108_right_new",
|
// };
|
||||||
|
// for(int a=0;a<(sizeof(modelusearr) / sizeof(modelusearr[0]));a++){
|
||||||
"filtered_C1autosave00004_right_new",
|
// SDRAM_USED();
|
||||||
"filtered_C1autosave00039_right_new",
|
// model_switchdata(modelusearr[a]);
|
||||||
"filtered_C1autosave00062_right_new",
|
// cnn_run();
|
||||||
|
// }
|
||||||
};
|
// printf("\r\n运行完成\r\n");
|
||||||
|
|
||||||
|
|
||||||
for(int a=0;a<(sizeof(modelusearr) / sizeof(modelusearr[0]));a++){
|
|
||||||
SDRAM_USED();
|
|
||||||
model_switchdata(modelusearr[a]);
|
|
||||||
cnn_run();
|
|
||||||
}
|
|
||||||
printf("\r\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
|
|
||||||
|
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
if(isrun)cnn_run();
|
if(isrun)cnn_run();
|
||||||
key=KEY_Scan(0);//<2F><>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
switch(key){
|
|
||||||
case 0://û<>а<EFBFBD><D0B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
break;
|
|
||||||
case KEY0_PRES: //KEY0<59><30><EFBFBD><EFBFBD>
|
|
||||||
isrun = 1;
|
|
||||||
break;
|
|
||||||
case KEY1_PRES: //KEY1<59><31><EFBFBD><EFBFBD>
|
|
||||||
model_dataset();
|
|
||||||
break;
|
|
||||||
case KEY2_PRES: //KEY1<59><31><EFBFBD><EFBFBD>
|
|
||||||
model_switchdata("C1autosave00095_right_new_2");
|
|
||||||
break;
|
|
||||||
case WKUP_PRES: //KEY1<59><31><EFBFBD><EFBFBD>
|
|
||||||
model_switchdata("data");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
delay_ms(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ struct _m_usmart_nametab usmart_nametab[]=
|
|||||||
(void*)read_addr,"u32 read_addr(u32 addr)",
|
(void*)read_addr,"u32 read_addr(u32 addr)",
|
||||||
(void*)write_addr,"void write_addr(u32 addr,u32 val)",
|
(void*)write_addr,"void write_addr(u32 addr,u32 val)",
|
||||||
#endif
|
#endif
|
||||||
(void*)W25QXX_Erase_Chip,"void W25QXX_Erase_Chip(void)",
|
|
||||||
(void*)mf_mount,"u8 mf_mount(u8* path,u8 mt)",
|
(void*)mf_mount,"u8 mf_mount(u8* path,u8 mt)",
|
||||||
(void*)mf_open,"u8 mf_open(u8*path,u8 mode)",
|
(void*)mf_open,"u8 mf_open(u8*path,u8 mode)",
|
||||||
(void*)mf_close,"u8 mf_close(void)",
|
(void*)mf_close,"u8 mf_close(void)",
|
||||||
@@ -44,19 +43,6 @@ struct _m_usmart_nametab usmart_nametab[]=
|
|||||||
(void*)mf_putc,"u8 mf_putc(u8 c)",
|
(void*)mf_putc,"u8 mf_putc(u8 c)",
|
||||||
(void*)mf_puts,"u8 mf_puts(u8*c)",
|
(void*)mf_puts,"u8 mf_puts(u8*c)",
|
||||||
|
|
||||||
(void*)NAND_EraseBlock,"u8 NAND_EraseBlock(u32 BlockNum)",
|
|
||||||
(void*)NAND_EraseChip,"void NAND_EraseChip(void)",
|
|
||||||
(void*)NAND_CopyPageWithoutWrite,"u8 NAND_CopyPageWithoutWrite(u32 Source_PageNum,u32 Dest_PageNum)",
|
|
||||||
|
|
||||||
(void*)FTL_Init,"u8 FTL_Init(void)",
|
|
||||||
(void*)FTL_CheckBadBlock,"u8 FTL_CheckBadBlock(u32 blocknum)",
|
|
||||||
(void*)FTL_UsedBlockMark,"u8 FTL_UsedBlockMark(u32 blocknum)",
|
|
||||||
(void*)FTL_FindUnusedBlock,"u32 FTL_FindUnusedBlock(u32 sblock,u8 flag)",
|
|
||||||
(void*)FTL_FindSamePlaneUnusedBlock,"u32 FTL_FindSamePlaneUnusedBlock(u32 blocknum)",
|
|
||||||
(void*)FTL_LBNToPBN,"u16 FTL_LBNToPBN(u32 blocknum)",
|
|
||||||
(void*)FTL_CreateLUT,"u8 FTL_CreateLUT(u8 mode)",
|
|
||||||
(void*)FTL_Format,"u8 FTL_Format(void)",
|
|
||||||
|
|
||||||
(void*)DEBUG,"void DEBUG(void)",
|
(void*)DEBUG,"void DEBUG(void)",
|
||||||
(void*)SDRAM_USED,"void SDRAM_USED(void)",
|
(void*)SDRAM_USED,"void SDRAM_USED(void)",
|
||||||
|
|
||||||
@@ -68,7 +54,6 @@ struct _m_usmart_nametab usmart_nametab[]=
|
|||||||
(void*)model_info,"u8 model_info(char* model_name)",
|
(void*)model_info,"u8 model_info(char* model_name)",
|
||||||
(void*)model_dataset,"void model_dataset(void)",
|
(void*)model_dataset,"void model_dataset(void)",
|
||||||
(void*)model_init,"void model_init(void)",
|
(void*)model_init,"void model_init(void)",
|
||||||
(void*)sd_read,"u8 sd_read(u32 length, char* model_name,u32 gap)",
|
|
||||||
|
|
||||||
(void*)_cnn_run,"void _cnn_run(void)",
|
(void*)_cnn_run,"void _cnn_run(void)",
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user