main.c

来自「最新版IAR FOR ARM(EWARM)5.11中的代码例子」· C语言 代码 · 共 52 行

C
52
字号
/*************************************************************************
 *
*    Used with ICCARM and AARM.
 *
 *    (c) Copyright IAR Systems 2006
 *
 *    File name   : main.c
 *    Description : Define main module
 *
 *    History :
 *    1. Date        : 18, January 2007
 *       Author      : Stanimir Bonev
 *       Description : Create
 *
 *  This example project shows how to use the IAR Embedded Workbench and PowerPac
 * RTOS for ARM to develop code for the IAR NXP-Giveaway demo board. It shows basic
 * use of the I/O, timers, a PWM, the interrupt controller and PowerPac RTOS.
 *  The example show running lights on the board LEDs. The left capacitive slider
 * change the speed and right change the intensity of the LEDs. When the board is
 * battery powered it stop after 30 sec and start again with the PWR_ON button.
 *
 *    $Revision: 1.0 $
 **************************************************************************/
#include "RTOS.H"
#include "BSP.H"
#include "power_ctrl.h"
#include "ctrl_task.h"
#include "cap_keys_task.h"


/*************************************************************************
 * Function Name: main
 * Parameters: none
 *
 * Return: none
 *
 * Description: main
 *
 *************************************************************************/
int main(void)
{
  OS_IncDI();     // Initially disable interrupts
  OS_InitKern();  // initialize OS
  OS_InitHW();    // initialize Hardware for OS
  BSP_Init();     // User specific initializations
  PowerCrltInit();
  OS_CREATETASK(&TCBCapKeys,  "Cap Keys Task",  CapKeysTask,  100,  StackCapKeys);
  OS_CREATETASK(&TCBCtrl,     "Control Task",   CtrlTask,     50,   StackCtrl);
  OS_Start();                      // Start multitasking
  return 0;
}

⌨️ 快捷键说明

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