@tehn - pulled the update in no problem; thanks. i had already made a very similar mod to your rx command to have a variable length buffer. i am, however, using the addr functionality to send a parameter to the slave that identifies the input # that the teletype wants to poll. i went ahead and integrated your changes into my branch and restored the original function under a new name as follows:

void i2c_master_tx_rx(uint8_t addr, uint8_t idx, uint8_t *data, uint8_t l) {
  int status;

  packet.chip = addr;
  // this allows the index of the input to be sent to the slave transmitter
  packet.addr[0] = idx;
  packet.addr_length = 1;
  // buffer and size of the return data
  packet.buffer = data;
  packet.length = l;

  status = twi_master_read(TWI, &packet);
}

it is pretty nifty how it works. the input module gets a quick command with the address that is about to be polled and then gets a request for a few bytes. this allows the i2c to be kept pretty lean as only the value that is needed is transmitted. i squeaked with it just worked out of the box.

My fork is here in case you are curious: https://github.com/bpcmusic/libavr32/tree/to_operator/src

still need to explore why this command is causing the unit to lock when called from the metro interrupt. had too much fun playing with quantization this weekend. :wink:

@scanner_darkly @sam - i have a list of the commands that i use to maintain my forked linked project if that would be helpful.

cheers!

b

1 Like