void Main(void) { //硬件初始化 var_Init();//初始化定时器相关的参数 Port_Init();//IO端口初始化 Isr_Init();//中断初始化 Uart_Init(0,115200);//串口初始化 Uart_Select(0); _init_alloc(0x32500000,0x333fffff);//初始化堆地址:15M,使能malloc等存储分配函数 setlocale(LC_ALL,"C");//使能本地函数,如sprintf等 Timer4_Init(); lcdTest(); }
int main(){ initScreen(); lcdTest(); while(1){ fillBoard(); printBoard(); for (int i = 0; i < 1000; i++){ playerStep(); printBoard(); } } closeScreen(); }
int main(){ initScreen(); initSound(); initLedButtons(); lcdTest(); while(1){ fillBoard(); printBoard(); for (int i = 0; i < 100; i++){ setLeds((char)i); setFrequency(120*(i%20)); playerStep(); printBoard(); playSounds(); if (readButtons() & 0x01 > 0) break; } } closeLedButtons(); closeScreen(); closeSound(); }
int main() { TestLCD lcdTest(8); lcdTest.loop(); return 0; }