flasher.c
来自「通过JTAG 控制 ARM9 核的一个程序」· C语言 代码 · 共 39 行
C
39 行
#define MAX_COUNT 800#define RED_LED 0x08000000;#define GREEN_LED 0x00100000;main(){ int count, threshold; unsigned long * drive_on; unsigned long * drive_off; drive_on = (unsigned long *) 0x30470008; drive_off = (unsigned long *) 0x30470010; *drive_off = GREEN_LED; /* loop for ever */ while (1) { for (threshold = 0; threshold < MAX_COUNT; threshold ++) { *drive_off = RED_LED; for (count = 0; count < MAX_COUNT; count ++) { if (count == threshold) *drive_on = RED_LED; } } for (threshold = 0; threshold < MAX_COUNT; threshold ++) { *drive_on = RED_LED; for (count = 0; count < MAX_COUNT; count ++) { if (count == threshold) *drive_off = RED_LED; } } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?