fixing stuff
This commit is contained in:
Plebs
2020-12-14 16:27:23 +01:00
parent 8f84159a7f
commit cb0766d200
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ void logErrorGpioNotOutput(const String& prefix, int port);
bool gpio_monitor_helper(int port, EventValueSource::Enum source, const char* Line);
bool gpio_unmonitor_helper(int port, EventValueSource::Enum source, const char* Line);
bool mcpgpio_range_pattern_helper(struct EventStruct *event, const char* Line, bool isWritePattern);
bool pcfgpio_range_pattern_helper(struct EventStruct *event, const char* Line, bool isWritePattern);
String Command_GPIO_Monitor(struct EventStruct *event, const char* Line)
{
@@ -729,7 +729,7 @@ bool pcfgpio_range_pattern_helper(struct EventStruct *event, const char* Line, b
for (byte i=0; i<numBytes; i++) {
uint8_t readValue;
byte currentAddress = firstAddress + i; ********
byte currentAddress = firstAddress + i;
if (currentAddress>0x27) currentAddress+=0x10;
byte currentMask = (mask >> (8*i)) & 0xFF;
+5 -4
View File
@@ -271,16 +271,17 @@ int8_t GPIO_PCF_Read(int Par1)
return state;
}
uint8_t GPIO_PCF_ReadAllPins(uint8_t address)
bool GPIO_PCF_ReadAllPins(uint8_t address, uint8_t *retValue)
{
uint8_t rawState = 0;
bool success = false;
Wire.requestFrom(address, (uint8_t)0x1);
if (Wire.available())
{
rawState =Wire.read();
success=true;
*retValue = Wire.read();
}
return rawState;
return success;
}
+1 -2
View File
@@ -68,8 +68,7 @@ void GPIO_MCP_Config(int Par1, byte Par2);
//********************************************************************************
//@giig1967g-20181023: changed to int8_t
int8_t GPIO_PCF_Read(int Par1);
uint8_t GPIO_PCF_ReadAllPins(uint8_t address);
bool GPIO_PCF_ReadAllPins(uint8_t address, uint8_t *retValue);
//********************************************************************************
// PCF8574 write