blinky.c

来自「包含了NXP众多的MCU的例子程序」· C语言 代码 · 共 46 行

C
46
字号
/*
  File: Blinky.c

  To blink the onboard LED (D3) of the Phytec PCM-023 board
  for every 65ms.

*/

#include <intrinsics.h>
#include "timer.h"
#include "lpc2294.h"

void main (void)
{
  // System initialization, this will map the exception vectors.
  LPC2294SystemInit();

  // Set up peripheral registers.
  LPC2294InitPIO();

  // First disable interrupts.
  __disable_interrupt();

  // Setup interrupt controller.
  LPC2294InitVIC();
  LPC2294InitTimerInterrupt(TimerBeat);

  // Periodic timer initialization.
  LPC2294InitTimer();

  // Enable interrupts.
  __enable_interrupt();

  // Start periodic timer.
  LPC2294StartTimer();

  // Loop forever.
  for (;;)
  {
    LPC2294LedSet();
    Sleep(200);      // Display for 65 ms.
    LPC2294LedClear();
    Sleep(200);      // Display for 65 ms.
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?