Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. void get_bricklet_plugin(uint8_t com, const GetBrickletPlugin *data) {
  2. // TODO: select port
  3.  
  4. const uint16_t length = i2c_eeprom_master_read_plugin_length(TWI1);
  5.  
  6. const uint16_t plugin_length = length + sizeof(GetBrickletPluginReturn);
  7.  
  8. uint8_t plugin[plugin_length];
  9.  
  10. GetBrickletPluginReturn *gbpr = plugin;
  11.  
  12. gbpr->stack_address = data->stack_address;
  13. gbpr->type = TYPE_GET_BRICKLET_PLUGIN;
  14. gbpr->plugin_length = plugin_length;
  15. gbpr->length = length;
  16.  
  17. i2c_eeprom_master_read_plugin(TWI1,
  18. plugin + sizeof(GetBrickletPluginReturn),
  19. length);
  20.  
  21. send_blocking_with_timeout(plugin, plugin_length, com);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement