monome / crow

Crow speaks and listens and remembers bits of text. A scriptable USB-CV-II machine
GNU General Public License v3.0
166 stars 34 forks source link

ii.set_address has no effect #430

Closed beels closed 3 years ago

beels commented 3 years ago

Following up on a comment by Justmat on //// (https://llllllll.co/t/crow-v3-0-1/46585/6) and then my own spelunking in the source code (https://llllllll.co/t/crow-v3-0-1/46585/7?u=3-foot-1) it looks like there may be no way for a user to change a crow's I2C address.

ii.set_address sets the address that is submitted to ii_find_command, but it appears that the filtering of messages on the I2C bus is done at the HAL level, so the address set by ii.set_address isn't actually used to differentiate between individual crows.

I think the only place where the HAL layer's idea of address is set is in the call to ii_init(II_CROW) in main (obviously hard-coding the CROW1 identity, and happening before the REPL is initialized so there is no way for it to reference a value set by the user). Can I2C_Init be safely called from I2C_SetAddress so that a user can set the address by putting a call to ii.set_address inside their init script?

trentgill commented 3 years ago

also note, the value is not saved to flash as it should be.