Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void get_bricklet_plugin(uint8_t com, const GetBrickletPlugin *data) {
- // TODO: select port
- const uint16_t length = i2c_eeprom_master_read_plugin_length(TWI1);
- const uint16_t plugin_length = length + sizeof(GetBrickletPluginReturn);
- GetBrickletPluginReturn gbpr = {
- data->stack_address,
- TYPE_GET_BRICKLET_PLUGIN,
- plugin_length,
- length
- };
- uint8_t plugin[plugin_length];
- memcpy(plugin, &gbpr, sizeof(GetBrickletPluginReturn));
- i2c_eeprom_master_read_plugin(TWI1,
- plugin + sizeof(GetBrickletPluginReturn),
- length);
- send_blocking_with_timeout(plugin, plugin_length, com);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement