Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SDC21XX_Motor SDC21XX_Motor
Diff: CANopen.cpp
- Revision:
- 1:a5e0bd1f1c93
- Parent:
- 0:0f99b1d63054
--- a/CANopen.cpp Mon May 30 11:28:35 2016 +0000
+++ b/CANopen.cpp Mon May 30 11:38:02 2016 +0000
@@ -32,7 +32,6 @@
}
int32_t CANopen::Send_Initiate_SDO_Upload(short index, short subindex)
{
- CANMessage _message;
char _data[8];
_data[0] = 0x60;
_data[1] = index;
@@ -42,11 +41,9 @@
_data[5] = 0;
_data[6] = 0;
_data[7] = 0;
- &_message.data = _data;
- message.len = 8;
- message.id = 0x600 + node_id;
+ CANMessage _message(0x600 + node_id, _data, 8);
can->write(_message);
- can->read(&_message);
+ can->read(_message);
return (_message.data[4] | _message.data[5] << 8 | _message.data[6] << 16 | _message.data[7] << 24);
}