diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-02 00:07:14 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-02 00:07:14 +0100 |
commit | 255e3d2dddd5d41e37d061f93f0739990753e541 (patch) | |
tree | fcb665cd3167236a3d17b6966ba9280995baee18 | |
parent | b1bd27388c8e09d5dba666377e01fbc5070be754 (diff) |
commandline: remove legacy 'vusb-i2c' program
-rw-r--r-- | commandline/Makefile | 8 | ||||
-rw-r--r-- | commandline/i2c.c | 65 |
2 files changed, 2 insertions, 71 deletions
diff --git a/commandline/Makefile b/commandline/Makefile index 2e2ea32..ae465ff 100644 --- a/commandline/Makefile +++ b/commandline/Makefile @@ -10,22 +10,18 @@ PREFIX ?= /usr/local bin_dir = ${DESTDIR}${PREFIX}/bin man_dir = ${DESTDIR}${PREFIX}/man/man1 -PROGRAMS = vusb-i2c vusb-i2cdetect vusb-i2cset vusb-i2cget +PROGRAMS = vusb-i2cdetect vusb-i2cset vusb-i2cget all: $(PROGRAMS) .c.o: $(CC) $(CFLAGS) -c $< -i2c.o: i2c.c i2c-util.c i2c-util.h i2c-util.o: i2c-util.c i2cdetect.o: i2cdetect.c i2c-util.c i2c-util.h i2cset.o: i2cset.c i2c-util.c i2c-util.h i2cget.o: i2cget.c i2c-util.c i2c-util.h -vusb-i2c: i2c.o i2c-util.o - $(CC) -o $@ $^ $(LIBS) - vusb-i2cdetect: i2cdetect.o i2c-util.o $(CC) -o $@ $^ $(LIBS) @@ -44,7 +40,7 @@ install: $(man_dir) uninstall: - rm -f $(bin_dir)/vusb-i2c $(bin_dir)/vusb-i2cdetect + rm -f $(bin_dir)/vusb-i2cdetect rm -f $(bin_dir)/vusb-i2cget $(bin_dir)/vusb-i2cset rm -f $(man_dir)/vusb-i2cdetect.1 $(man_dir)/vusb-i2cget.1 $(man_dir)vusb-i2cset.1 diff --git a/commandline/i2c.c b/commandline/i2c.c deleted file mode 100644 index ce0f70e..0000000 --- a/commandline/i2c.c +++ /dev/null @@ -1,65 +0,0 @@ -#include <unistd.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "i2c-util.h" - -int main(int argc, char **argv) -{ - char line[8]; - signed char i; - short int number; - - char bit_sda = 6; - - i2c_init(); - i2c_start(); - puts("ready"); - - while (fgets(line, 8, stdin) != NULL) { - if (sscanf(line, "%hi\n", &number) == 1) { - if ((number >= 0) && (number <= 256)) { - for (i = 7; i >= -1; i--) { - if ((i < 0) || (number == 256) || (number & (1 << i))) { - puts("sda ↑"); - set_sda(1); - //verify_sda_high(); - } else { - puts("sda ↓"); - set_sda(0); - //verify_sda_low(); - } - usleep(10); - puts("scl ↑"); - set_scl(1); - usleep(10); - //verify_scl_high(); - if (i < 0) { - if (get_status() & (1 << bit_sda)) - puts("> NAK"); - else - puts("> ACK"); - } - else if (number == 256) { - if (get_status() & (1 << bit_sda)) - puts("1"); - else - puts("0"); - } - puts("scl ↓"); - set_scl(0); - usleep(10); - //verify_scl_low(); - } - } - } - if (strcmp(line, "push\n") == 0) { - i2c_stop(); - i2c_start(); - } - } - - i2c_stop(); - i2c_deinit(); - return 0; -} |