int main(void) { PLL_Init(); // 80 MHz ADCTimerINT_Init(7999); // 10KHz EnableInterrupts(); // Enable global interrupt register flag UART0_Init(); TLV5618_Init(); Sound_Init(); UART0_TxString("Hi, Sir"); ToggleDebug(); //Sound_Tone(4780); while(1) { //delay(20); WaitForInterrupt(); } }
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_KEYDOWN: switch (wParam) { case VK_ESCAPE: PostQuitMessage(0); break; case VK_LEFT: TurnPlayer(-500); break; case VK_RIGHT: TurnPlayer(500); break; case VK_UP: MovePlayer(5); break; case VK_DOWN: MovePlayer(-5); break; case VK_TAB: ToggleDebug(); break; } break; case WM_CLOSE: DestroyWindow(g_hwnd); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } }