diff --git a/bcu.c b/bcu.c index 4cd0bf1..d5db674 100644 --- a/bcu.c +++ b/bcu.c @@ -189,6 +189,7 @@ static void print_help(char* cmd) printf(" %s%-50s%s%s\n", g_vt_default, " [-nodisplay] [-hz=] [-hwfilter]", g_vt_green, ""); printf(" %s%-50s%s%s\n", g_vt_default, " [-unipolar]", g_vt_green, ""); printf("\n"); + printf(" %s%-50s%s%s\n", g_vt_default, "get_level [GPIO_NAME] [-board=] [-id=]", g_vt_green, "get level state of pin GPIO_NAME"); printf(" %s%-50s%s%s\n", g_vt_default, "set_gpio [GPIO_NAME] [1/0] [-board=] [-id=]", g_vt_green, "set pin GPIO_NAME to be high(1) or low(0)"); printf(" %s%-50s%s%s\n", g_vt_default, "set_boot_mode [BOOTMODE_NAME] [-board=] [-id=]", g_vt_green, "set BOOTMODE_NAME as boot mode"); printf("\n"); diff --git a/chip.c b/chip.c index fd33aab..69f7938 100644 --- a/chip.c +++ b/chip.c @@ -882,9 +882,6 @@ int pca6416a_read(void* pca6416a, unsigned char* bit_value_buffer) unsigned char input_cmd = (pca->port) + 0x00; //x00h is the input command int bSucceed = 0; - if(pca->gpio_device.opendrain > 0) - input_cmd = (pca->port) + 0x6; - bSucceed = parent->i2c_start(parent); if (bSucceed) return bSucceed; bSucceed = parent->i2c_write(parent, addr_plus_write, I2C_TYPE_GPIO); @@ -901,7 +898,7 @@ int pca6416a_read(void* pca6416a, unsigned char* bit_value_buffer) if (bSucceed) return bSucceed; //mask away unwanted value; - *bit_value_buffer = (*bit_value_buffer) & (~pca->gpio_device.pin_bitmask); + *bit_value_buffer = (*bit_value_buffer) & (pca->gpio_device.pin_bitmask); return 0; } @@ -1111,9 +1108,6 @@ int pcal6524h_read(void* pcal6524h, unsigned char* bit_value_buffer) unsigned char input_cmd = (pca->port) + 0x00; //x00h is the input command int bSucceed = 0; - if (pca->gpio_device.opendrain > 0) - input_cmd = (pca->port) + 0x6; - bSucceed = parent->i2c_start(parent); if (bSucceed) return bSucceed; bSucceed = parent->i2c_write(parent, addr_plus_write, I2C_TYPE_GPIO);