Esempio n. 1
0
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned long ulLEDs;

  	/* Suspend all other tasks, in order to make sure no other tasks excecutes
	this code at the same time. */
	vTaskSuspendAll();
	{
		ulLEDs = DVK_getLEDs();
		
		if( xValue == pdTRUE )
		{
			/* Turn the LED on if xValue is true. */
			ulLEDs = ulLEDs | ( 1 << uxLED );
		}
		else
		{
			/* Turn the LED off if xValue is not true. */
			ulLEDs &= ~( 1 << uxLED );
		}
	
		DVK_setLEDs( ulLEDs );
	}	
 	xTaskResumeAll();
}
Esempio n. 2
0
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned long ulLEDs;

	vTaskSuspendAll();
	{
		ulLEDs = DVK_getLEDs();
		ulLEDs = ulLEDs ^ ( 1 << uxLED );
		DVK_setLEDs( ulLEDs );
	}
	xTaskResumeAll();
}
Esempio n. 3
0
/***************************************************************************//**
 * @brief
 *   Turn off a LED
 *
 * @details
 *
 * @note
 *
 * @param[in] num
 *   LED number
 *
 ******************************************************************************/
void rt_hw_led_off(rt_uint8_t num)
{
    RT_ASSERT(num < LEDS_MAX_NUMBER);

#if defined(EFM32_G8XX_STK)
    GPIO_PinOutClear(leds_list[num][0], leds_list[num][1]);
#elif (defined(EFM32_GXXX_DK) || defined(EFM32GG_DK3750))
{
    rt_uint16_t leds;

    leds = DVK_getLEDs() & ~(rt_uint16_t)(1 << num);
    DVK_setLEDs(leds);
}
#endif
}
Esempio n. 4
0
void vParTestInitialise( void )
{
	DVK_init();
	DVK_setLEDs( 0 );
}