خرید بک لینک

/*

A call to osDelay will put the calling thread in the WAITING state for the

specified amount of milliseconds. During this time, the RTOS scheduler will

run other threads in the READY state.

*/

void alive_led (void *argument) {

uint8_t onoff = 0;

GPIO_SetDir(2, 13, GPIO_DIR_OUTPUT);

while (true) {

onoff = !onoff;

if (onoff)

GPIO_PinWrite(2, 13, 1);

else

GPIO_PinWrite(2, 13, 0);

osDelay(1000); // suspend thread execution

}

برچسب: نویسنده: هستی رستمیان تاريخ: يکشنبه 4 تير 1396 ساعت: 23:15

صفحه بندی