New bytearray implementation buggy or not used as intended?
Posted: Sun Jan 04, 2015 1:36 pm
With firmware verisons 1.3.7 I can run the OLED display library forked from the other thread without any problems (SSD1306 using I2C). After updating the firmware to any 1.3.8 version I do get the following TypeError:
Within this library a bytearray gets initialized with a computed size:
Of course we do see a lot of recent changes around the bytearray thingy. Am I using this not as intended anymore? I did check the soure-code and the test cases in Github, but i have no real clue on what i may do wrong. Maybe initializing the bytearray with an integer or integer arithmetic result (int object) is handled differently!?
If this is a bug i will of course file one on Github. Just wanted to make sure this is not my fault
Code: Select all
Micro Python v1.3.8-9-g8a2cc1c on 2014-12-30; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>> import ssd1306_test2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ssd1306_test2.py", line 30, in <module>
File "ssd1306.py", line 179, in init_display
File "ssd1306.py", line 120, in clear
TypeError: 'int' object is not iterable
>>>
Code: Select all
def clear(self):
"""Clears the display buffer. This is equivalent to setting the
whole screen black."""
self.display_buffer = bytearray(self.offset + self.pages * self.width)
if self.offset == 1:
self.display_buffer[0] = CTL_DAT
If this is a bug i will of course file one on Github. Just wanted to make sure this is not my fault
