From: chaoskagami Date: Sun, 19 Jun 2016 01:10:07 +0000 (-0400) Subject: Replace upstream bdfe with a stripped down fork X-Git-Tag: v0.1.1~15 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=20ff71ad7fab58954928d8aa0e2c5a0c36a8241d;p=corbenik%2Fcorbenik.git Replace upstream bdfe with a stripped down fork --- diff --git a/.gitmodules b/.gitmodules index 6d17175..0dd8102 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "host/bdfe"] - path = host/bdfe - url = https://github.com/achilikin/bdfe [submodule "external/tewi-font"] path = external/tewi-font url = https://github.com/Lucy/tewi-font +[submodule "host/bdfe"] + path = host/bdfe + url = https://github.com/chaoskagami/bdfe diff --git a/host/bdfe b/host/bdfe index dba10ac..359f34a 160000 --- a/host/bdfe +++ b/host/bdfe @@ -1 +1 @@ -Subproject commit dba10ac9b796bdac744b8ad6acdc299461fc867d +Subproject commit 359f34a0012bd58c86a5c171695abf8874a7e7b2 diff --git a/host/stub-i2c-bdfe.patch b/host/stub-i2c-bdfe.patch deleted file mode 100644 index 38fd683..0000000 --- a/host/stub-i2c-bdfe.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff -urN bdfe/li2c.c bdfe-stubi2c/li2c.c ---- a/host/bdfe/li2c.c 2016-06-18 23:35:56.639775500 +0000 -+++ b/host/bdfe/li2c.c 2016-06-18 23:35:15.467047200 +0000 -@@ -38,95 +38,34 @@ - options i2c_bcm2708 baudrate=400000 - */ - --#include --#include --#include --#include --#include -- - #include "li2c.h" - --/* by default RPi mode, so bus 1 is valid for RPi and Edison */ --static li2c_mode_t i2c_mode = LI2C_RPI; -- --/** i2c bus file descriptors */ --static int i2c_bus[LI2C_MAX_BUS]; -- --static int is_valid_bus(uint8_t bus) --{ -- if (i2c_mode == LI2C_RPI) { -- if (bus > PI2C_MAX_BUS) -- return 0; -- return 1; -- } -- if (i2c_mode == LI2C_EDISON) { -- if (bus > EDI2C_MAX_BUS) -- return 0; -- return 1; -- } -- return 0; --} -- - /* select I2C mode - Raspberry or Edison for bus index validation */ - int li2c_init(li2c_mode_t mode) - { -- for(int i = 0; i < LI2C_MAX_BUS; i++) -- i2c_bus[i] = -1; -- i2c_mode = mode; - return 0; - } - - /** open I2C bus if not opened yet and store file descriptor */ - int li2c_open(uint8_t bus) - { -- char bus_name[64]; -- -- if (!is_valid_bus(bus)) -- return -1; -- -- // already opened? -- if (i2c_bus[bus] >= 0) -- return 0; -- -- // open i2c bus and store file descriptor -- sprintf(bus_name, "/dev/i2c-%u", bus); -- -- if ((i2c_bus[bus] = open(bus_name, O_RDWR)) < 0) -- return -1; -- - return 0; - } - - /** close I2C bus file descriptor */ - int li2c_close(uint8_t bus) - { -- if (!is_valid_bus(bus)) -- return -1; -- -- if (i2c_bus[bus] >= 0) -- close(i2c_bus[bus]); -- i2c_bus[bus] = -1; -- - return 0; - } - - /** select I2C device for li2c_write() calls */ - int li2c_select(uint8_t bus, uint8_t slave) - { -- if (!is_valid_bus(bus) || (i2c_bus[bus] < 0)) -- return -1; -- -- return ioctl(i2c_bus[bus], I2C_SLAVE, slave); -+ return 0; - } - - /** write to I2C device selected by li2c_select() */ - int li2c_write(uint8_t bus, const uint8_t *data, uint32_t len) - { -- if (!is_valid_bus(bus) || (i2c_bus[bus] < 0)) -- return -1; -- -- if (write(i2c_bus[bus], data, len) != (ssize_t)len) -- return -1; -- - return 0; - }