{"action":"opened","issue":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/474","repository_url":"https://api.github.com/repos/bbcmicrobit/micropython","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/474/labels{/name}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/474/comments","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/474/events","html_url":"https://github.com/bbcmicrobit/micropython/issues/474","id":265595180,"number":474,"title":"First two transactions after i2c.init() raise OSError -1010","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars1.githubusercontent.com/u/1181357?v=4","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-15T19:04:25Z","updated_at":"2017-10-15T19:04:25Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm writing a driver for controlling the SH1106 OLED display over I²C from micro:bit, and I'm using pins 1 and 2 for this, because of their easy connectivity. I noticed that after I call `microbit.i2c.init(freq=400000, scl=microbit.pin2, sda=microbit.pin1)` to switch the pins, the first two calls to `microbit.i2c.write()` always fail with `OSError: I2C write failed with error code -1010` (and no data is sent on the pins), but afterwards it all works fine. Right now I'm just calling an empty write twice and catch the exception to work around that, but it might be a symptom of some state not being cleaned somewhere."}}
{"actor":{"display_login":"deshipu"}}