MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / handle_set_position

Function handle_set_position

rotators/ars/ars.c:415–444  ·  view source on GitHub ↗

* Thread handler */

Source from the content-addressed store, hash-verified

413 * Thread handler
414 */
415static void *handle_set_position(void *arg)
416{
417 ROT *rot = (ROT *) arg;
418 struct ars_priv_data *priv = (struct ars_priv_data *)ROTSTATE(rot)->priv;
419 int retcode;
420
421 while (1)
422 {
423
424 if (!priv->set_pos_active)
425 {
426 /* TODO: replace polling period by cond var */
427 hl_usleep(100 * 1000 - 1);
428 continue;
429 }
430
431 retcode = ars_set_position_sync(rot, priv->target_az, priv->target_el);
432 priv->set_pos_active = 0;
433
434 if (retcode != RIG_OK)
435 {
436 rig_debug(RIG_DEBUG_WARN, "%s: ars_set_position_sync() failed: %s\n",
437 __func__, rigerror(retcode));
438 hl_usleep(1000 * 1000);
439 continue;
440 }
441 }
442
443 return NULL;
444}
445
446/*
447 * ars_set_position_sync() is synchronous.

Callers

nothing calls this directly

Calls 4

hl_usleepFunction · 0.85
ars_set_position_syncFunction · 0.85
rig_debugFunction · 0.85
rigerrorFunction · 0.85

Tested by

no test coverage detected