Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
484 B
3
Indexable
def batch_create_pcan_buses(bitrate, dbitrate, single=None):
    try: 
        if single == 1:
            return create_pcan_bus('PCAN_USBBUS1', bitrate, dbitrate), None
        elif single == 2:
            return None, create_pcan_bus('PCAN_USBBUS2', bitrate, dbitrate)
        else:
            return create_pcan_bus('PCAN_USBBUS1', bitrate, dbitrate), create_pcan_bus('PCAN_USBBUS2', bitrate, dbitrate)
    except PcanCanInitializationError:
        return None, None