python-msp430-tools icon indicating copy to clipboard operation
python-msp430-tools copied to clipboard

MSP430_Initialize() call fails in Python 3

Open mventimi opened this issue 6 years ago • 0 comments

The open() method in the MSP430Library class takes a string argument for the port. However, in Python 3 the call to MSP430_Initialize() requires a bytes argument, not a string argument. Changing this line:

status = MSP430_Initialize(port, ctypes.byref(version))

to this:

status = MSP430_Initialize(bytes(port, encoding='ascii'), ctypes.byref(version))

is one way to fix the problem.

mventimi avatar May 10 '19 18:05 mventimi