mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
digital.c for CLI
This commit is contained in:
parent
cfe058c5d5
commit
580139c6e4
22
libraries/Desktop/support/digital.c
Normal file
22
libraries/Desktop/support/digital.c
Normal file
@ -0,0 +1,22 @@
|
||||
// support for digitalRead() and digitalWrite()
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdint.h>
|
||||
#include "desktop.h"
|
||||
|
||||
|
||||
int digitalRead(uint8_t address)
|
||||
{
|
||||
switch (address) {
|
||||
case 40:
|
||||
// CLI slider switch
|
||||
return desktop_state.slider?0:1;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
printf("digitalRead(0x%x) unsupported\n", address);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user