Improved IO16-Bricklet.
This commit is contained in:
@@ -197,7 +197,17 @@ void TfIO16Bricklet::setPort(char port, uint8_t value_mask) {
|
||||
}
|
||||
|
||||
void TfIO16Bricklet::setPort(char port, uint8_t pin_mask, bool value) {
|
||||
throw TfError("Not implemented", TfErrorCode::E_UNKNOWN_ERROR_CODE);
|
||||
uint8_t mask;
|
||||
if (port == 'a') {
|
||||
mask = outMapA = (outMapA & ~pin_mask) | ((value ? 0xFF : 0x00) & pin_mask);
|
||||
} else if (port == 'b') {
|
||||
mask = outMapB = (outMapB & ~pin_mask) | ((value ? 0xFF : 0x00) & pin_mask);
|
||||
} else {
|
||||
std::ostringstream ss;
|
||||
ss << "Unknown Port: " << port << ".";
|
||||
throw TfError(ss.str(), TfErrorCode::E_INVALID_PARAMETER);
|
||||
}
|
||||
setPort(port, mask);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user