From ee99ec839bfe3630994ce506f5fa192f021054bb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Nov 2011 22:22:09 +1100 Subject: [PATCH] digital.c for CLI --- libraries/Desktop/support/digital.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 libraries/Desktop/support/digital.c diff --git a/libraries/Desktop/support/digital.c b/libraries/Desktop/support/digital.c new file mode 100644 index 0000000000..691c887999 --- /dev/null +++ b/libraries/Desktop/support/digital.c @@ -0,0 +1,22 @@ +// support for digitalRead() and digitalWrite() +#include +#include +#include +#include +#include +#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; +}