Ejemplo n.º 1
0
__EXPORT void led_toggle(int led)
{
	if (led == 1) {
		if (px4_arch_gpioread(GPIO_LED1)) {
			px4_arch_gpiowrite(GPIO_LED1, false);

		} else {
			px4_arch_gpiowrite(GPIO_LED1, true);
		}
	}
}
Ejemplo n.º 2
0
int
Syslink::send_bytes(const void *data, size_t len)
{
	// TODO: This could be way more efficient
	//       Using interrupts/DMA/polling would be much better
	for (size_t i = 0; i < len; i++) {
		// Block until we can send a byte
		while (px4_arch_gpioread(GPIO_NRF_TXEN)) ;

		write(_fd, ((const char *)data) + i, 1);
	}

	return 0;
}
Ejemplo n.º 3
0
uint8_t test_nready(void){
	uint8_t nready;
	nready = px4_arch_gpioread(GPIO_wifi_nready);
	return nready;
}
Ejemplo n.º 4
0
uint8_t test_nlink(void){
	uint8_t nlink;
	nlink = px4_arch_gpioread(GPIO_wifi_nlink);
	return nlink;
}