Esempio n. 1
0
File: main.c Progetto: Hzza3/TM4C12x
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();
	}
}
Esempio n. 2
0
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);
    }
}