digital.c for CLI

This commit is contained in:
Andrew Tridgell 2011-11-07 22:22:09 +11:00
parent 5410dff523
commit ee99ec839b
1 changed files with 22 additions and 0 deletions

View 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;
}