摘要: #include int checkCPU() { union w{ int a; char b; }c; c.a = 1; return (c.b == 1); } int main() { printf("This CPU is %s\n", checkCPU() ? "little" : "big"); ... 阅读全文
posted @ 2019-07-17 16:12 Vedic 阅读(450) 评论(0) 推荐(0) 编辑
摘要: #include #define LINUX_REBOOT_CMD_RESTART 0x01234567 int main() { reboot(LINUX_REBOOT_CMD_RESTART); return 0; } 阅读全文
posted @ 2019-07-17 16:09 Vedic 阅读(325) 评论(0) 推荐(0) 编辑
摘要: /* main.c */ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <unist 阅读全文
posted @ 2019-07-17 16:06 Vedic 阅读(608) 评论(0) 推荐(0) 编辑
摘要: /* uart_tx.c */ #include #include #include #include #include #include #include #include #include #include #define TEST_LEN (1024 * 400) static char *dev_name = "/dev/ttyS2"; static int bau... 阅读全文
posted @ 2019-07-17 15:48 Vedic 阅读(1171) 评论(0) 推荐(0) 编辑