Commit 17680a19d9af90cb2922b3521539685c06bb846d

Con Kolivas 2014-01-04T09:30:33

Return only binary values for mcp2210 GPIO values.

diff --git a/mcp2210.c b/mcp2210.c
index 06d62ba..07c655f 100644
--- a/mcp2210.c
+++ b/mcp2210.c
@@ -55,7 +55,7 @@ bool mcp2210_get_gpio_pindes(struct cgpu_info *cgpu, struct gpio_pin *gp)
 		return false;
 
 	for (i = 0; i < 9; i++)
-		gp->pin[i] = buf[4 + i];
+		gp->pin[i] = !!(buf[4 + i]);
 	return true;
 }
 
@@ -72,7 +72,7 @@ bool mcp2210_get_gpio_pinvals(struct cgpu_info *cgpu, struct gpio_pin *gp)
 		return false;
 
 	for (i = 0; i < 8; i++)
-		gp->pin[i] = buf[4] & (0x01u << i);
+		gp->pin[i] = !!(buf[4] & (0x01u << i));
 	gp->pin[8] = buf[5] & 0x01u;
 
 	return true;
@@ -90,7 +90,7 @@ bool mcp2210_get_gpio_pindirs(struct cgpu_info *cgpu, struct gpio_pin *gp)
 		return false;
 
 	for (i = 0; i < 8; i++)
-		gp->pin[i] = buf[4] & (0x01u << i);
+		gp->pin[i] = !!(buf[4] & (0x01u << i));
 	gp->pin[8] = buf[5] & 0x01u;
 
 	return true;