Exemplo n.º 1
0
extern int32_t PIOS_GCSRCVR_Init(uintptr_t *gcsrcvr_id)
{
	struct pios_gcsrcvr_dev *gcsrcvr_dev;

	/* Allocate the device structure */
	gcsrcvr_dev = (struct pios_gcsrcvr_dev *)PIOS_gcsrcvr_alloc();
	if (!gcsrcvr_dev)
		return -1;

	/* Register uavobj callback */
	GCSReceiverConnectCallback (gcsreceiver_updated);

	return 0;
}
Exemplo n.º 2
0
extern int32_t PIOS_GCSRCVR_Init(uint32_t *gcsrcvr_id)
{
	struct pios_gcsrcvr_dev *gcsrcvr_dev;

	/* Allocate the device structure */
	gcsrcvr_dev = (struct pios_gcsrcvr_dev *)PIOS_gcsrcvr_alloc();
	if (!gcsrcvr_dev)
		return -1;

	/* Register uavobj callback */
	GCSReceiverConnectCallback (gcsreceiver_updated);

	/* Register the failsafe timer callback. */
	if (!PIOS_RTC_RegisterTickCallback(PIOS_gcsrcvr_Supervisor, (uint32_t)gcsrcvr_dev)) {
		PIOS_DEBUG_Assert(0);
	}

	return 0;
}
Exemplo n.º 3
0
extern int32_t PIOS_GCSRCVR_Init(uintptr_t *gcsrcvr_id)
{
	struct pios_gcsrcvr_dev *gcsrcvr_dev;

	/* Allocate the device structure */
	gcsrcvr_dev = (struct pios_gcsrcvr_dev *)PIOS_gcsrcvr_alloc();
	if (!gcsrcvr_dev)
		return -1;

	for (uint8_t i = 0; i < GCSRECEIVER_CHANNEL_NUMELEM; i++) {
		/* Flush channels */
		gcsreceiverdata.Channel[i] = PIOS_RCVR_TIMEOUT;
	}

	/* Register uavobj callback */
	GCSReceiverConnectCallback (gcsreceiver_updated);

	/* Register the failsafe timer callback. */
	if (!PIOS_RTC_RegisterTickCallback(PIOS_gcsrcvr_Supervisor, (uintptr_t)gcsrcvr_dev)) {
		PIOS_DEBUG_Assert(0);
	}

	return 0;
}