70 lines
1.8 KiB
C
70 lines
1.8 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <time.h>
|
|
#include "t_spi.h"
|
|
#include "t_iic.h"
|
|
#include "t_task.h"
|
|
#include "t_arg.h"
|
|
#include "t_list.h"
|
|
#include "t_key.h"
|
|
#include "t_oled.h"
|
|
#include "tool.h"
|
|
#include <windows.h>
|
|
#include <stdint.h>
|
|
|
|
int main() {
|
|
srand((unsigned) time(NULL));
|
|
int i, j, k = 0;
|
|
unsigned char incode[3] = "我"; // 要读出的汉字
|
|
unsigned char qh, wh;
|
|
long offset = 0;
|
|
// 占两个字节, 取其区位号
|
|
qh = incode[0] - 0xa0;//获得区码
|
|
wh = incode[1] - 0xa0; //获得位码
|
|
offset = (94 * (qh - 1) + (wh - 1)) * 24; /*得到偏移位置*/
|
|
|
|
FILE *HZK;
|
|
uint8_t temp, mat[24];
|
|
if ((HZK = fopen("HZK12", "rb")) == NULL) {
|
|
printf("Can't Open hzk16\n");
|
|
exit(0);
|
|
}
|
|
fseek(HZK, offset, SEEK_SET);
|
|
fread(mat, 24, 1, HZK);
|
|
// Buf_Print("KZK12",mat,24,12);
|
|
for (i = 0; i < 24; i++)
|
|
printf("0x%02X, ", mat[i]);
|
|
// for (i = 0; i < 24; i++) {
|
|
// temp = mat[i];
|
|
// for (j = 0; j < 8; j++) //写入数据
|
|
// {
|
|
// if (temp & 0x80)printf("%c", '#');
|
|
// else printf("%c", '-');
|
|
// temp <<= 1;
|
|
// k++;
|
|
// if ((k ) == 12) {
|
|
// k = 0;
|
|
//// x++;
|
|
// printf("\n");
|
|
// break;
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// int i = 1;
|
|
// POUT((++i) + (++i));
|
|
//
|
|
// char str[] = "123.456";
|
|
// float result = Str2Float(str);
|
|
// printf("Result: %.3f\n", result);
|
|
// Test_RunTime("SPI", Test_spi);
|
|
// Test_RunTime("IIC", Test_iic);
|
|
// Test_RunTime("ArgPase", Test_argpase);
|
|
// Test_RunTime("List", Test_List);
|
|
// Test_RunTime("Key", Test_Key);
|
|
// Test_RunTime("Queue", Test_Queue);
|
|
// Test_RunTime("Task", Test_task);
|
|
Test_RunTime("OLED", Test_OLED);
|
|
return 0;
|
|
}
|