MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_led_toggle

Function rt_hw_led_toggle

bsp/efm32/dev_led.c:108–122  ·  view source on GitHub ↗

/ * @brief * Toggle the state of a LED * * @details * * @note * * @param[in] num * LED number * ******************************************************************************/

Source from the content-addressed store, hash-verified

106 *
107 ******************************************************************************/
108void rt_hw_led_toggle(rt_uint8_t num)
109{
110 RT_ASSERT(num < LEDS_MAX_NUMBER);
111
112#if defined(EFM32_G8XX_STK)
113 GPIO_PinOutToggle(leds_list[num][0], leds_list[num][1]);
114#elif (defined(EFM32_GXXX_DK) || defined(EFM32GG_DK3750))
115{
116 rt_uint16_t leds;
117
118 leds = DVK_getLEDs() ^ (rt_uint16_t)(1 << num);
119 DVK_setLEDs(leds);
120}
121#endif
122}
123
124rt_uint8_t rt_hw_led_state(rt_uint8_t num)
125{

Callers 1

rt_led_thread_entryFunction · 0.70

Calls 3

GPIO_PinOutToggleFunction · 0.85
DVK_getLEDsFunction · 0.50
DVK_setLEDsFunction · 0.50

Tested by

no test coverage detected