Esempio n. 1
0
/******************************************************************************
* LED_TurnOffLed
*
* Turns off on or more LEDs. Doesn't check/affect flashing states.
*******************************************************************************/
void LED_TurnOffLed(LED_t LEDNr)
{
  if (LEDNr & LED1)
    Led1Off();
  if (LEDNr & LED2)
    Led2Off();
  if (LEDNr & LED3)
    Led3Off();
  if (LEDNr & LED4)
    Led4Off();
}
Esempio n. 2
0
void Main(void)
 {
  InterruptInit();
  IntDisableAll();
  Platform_Init();
  

  TS_Init();                            /* Init the kernel. */
  TMR_Init();                           /* Init the TMR module */							
  NvModuleInit();
  Uart_ModuleInit();
  /* This only creates the MAC TS thread. */
  MacInit();
  /* Use TS for MAC  - the MAC TS ID must be known at this step. */
  Init_802_15_4(TRUE);

  #if gZtcIncluded_d
  Ztc_TaskInit();
  #endif /* gZtcIncluded_d */ 

  /*initialize the application*/ 
  gAppTaskID_c = TS_CreateTask(gTsAppTaskPriority_c, AppTask);
 
  MApp_init();
  #if (gLpmIncluded_d == 1)
    /*do not allow the device to enter sleep mode*/
    PWR_DisallowDeviceToSleep();
  #endif /* gLpmIncluded_d == 1 */
 
  /*All LED's are switched OFF*/
  Led1Off();
  Led2Off();
  Led3Off();
  Led4Off();
  
  /* Start the task scheduler. Does not return. */
  TS_Scheduler(); 
 
}
Esempio n. 3
0
void MotorClass::Task(void)
{
	bOverloadFlag=0;
	if (iOverloadDelay==OVERLOAD_DELAY)
	{
		iCurrentConsumption=CurrentAdc.GetValue();
		switch (chState)
		{
		case MOTOR_UPWARD:
			if (iCurrentConsumption>OVERLOAD_LEVEL_UP) bOverloadFlag=1;
			break;
		case MOTOR_DOWNWARD:
			if (iCurrentConsumption>OVERLOAD_LEVEL_DOWN) bOverloadFlag=1;
			break;
		}
	}
	else iOverloadDelay++;

	if (bOverloadFlag) Led4On();
	else Led4Off();
	return;
}