int IsBig_Endian(void)
{
//大赋值小,出问题
uint16_t test = 0x1234;
uint8_t test8 = 0;
printf("\n bigtolite \r\n");
test8=test;
printf("test8=test data: 0x%x \r\n", test8);
test8=(uint8_t)(test);
printf(" test8=(uint8_t)(test) data: 0x%x \r\n", test8);
printf("\n big addr \r\n");
printf("test data: 0x%x \r\n", test8);
printf("test addr: 0x%p \r\n", &test8);
printf("test addr: 0x%p \r\n", (uint8_t*) &test8);
printf("test addr: 0x%x \r\n", (*( (uint8_t*) &test8 )));
printf("\n bigtolite addr \r\n");
test8=*((uint8_t*)(&test));
printf("test8=*((uint8_t*)(&test)) data: 0x%x \r\n", test8);
printf("&test addr: 0x%p \r\n", &test);
printf("(uint8_t*) &test addr: 0x%p \r\n", (uint8_t*) &test);
printf("(*( (uint8_t*) &test ) data: 0x%x \r\n", (*( (uint8_t*) &test )));
printf("\n litetobig \r\n");
test8 = 0x56;
test = test8;
printf("test8 addr: 0x%p \r\n", &test8);
printf("test data: 0x%x \r\n", test);
printf("test addr: 0x%p \r\n", &test);
printf("test addr: 0x%p \r\n", (uint8_t*) &test);
printf("test addr: 0x%x \r\n", (*( (uint8_t*) &test )));
if(*( (uint8_t*) &test ) == 0x12)
return 0;
else
return -1;
}