freemyipod r938 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r937‎ | r938 | r939 >
Date:04:45, 7 June 2014
Author:theseven
Status:new
Tags:
Comment:
emcore.py: Make i2cwrite command work with python 3.x as well
Modified paths:
  • /emcore/trunk/tools/emcore.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcore.py
@@ -397,7 +397,7 @@
398398 addr = to_int(addr)
399399 data = b""
400400 for arg in args:
401 - data += chr(to_int(arg))
 401+ data += struct.pack("B", to_int(arg))
402402 self.logger.info("Writing data to I2C...\n")
403403 self.emcore.i2cwrite(bus, slave, addr, data)
404404 self.logger.info("done\n")