1
0
Fork 0

Fix reading OD entry 1003,0, etc.

This commit is contained in:
Janez 2021-06-26 13:35:43 +02:00
parent 3749297b39
commit cdad71beee
4 changed files with 6 additions and 6 deletions

View file

@ -186,7 +186,9 @@ static ODR_t OD_write_1015(OD_stream_t *stream, const void *buf,
static ODR_t OD_read_1003(OD_stream_t *stream, void *buf,
OD_size_t count, OD_size_t *countRead)
{
if (stream == NULL || buf == NULL || count < 4 || countRead == NULL) {
if (stream == NULL || buf == NULL || countRead == NULL
|| (count < 4 && stream->subIndex > 0) || count < 1
) {
return ODR_DEV_INCOMPAT;
}

View file

@ -2,7 +2,7 @@
* Configuration macros for CANopenNode.
*
* @file CO_config.h
* @ingroup CO_driver
* @ingroup CO_STACK_CONFIG
* @author Janez Paternoster
* @copyright 2020 Janez Paternoster
*

View file

@ -439,7 +439,6 @@ CO_t *CO_new(CO_config_t *config, uint32_t *heapMemoryUsed) {
if (p == NULL) break;
else co->RPDO = (CO_RPDO_t *)p;
mem += sizeof(CO_RPDO_t) * CO_GET_CNT(RPDO);
ON_MULTI_OD(co->CNT_RPDO = config->CNT_RPDO);
ON_MULTI_OD(RX_CNT_RPDO = config->CNT_RPDO);
}
#endif
@ -451,7 +450,6 @@ CO_t *CO_new(CO_config_t *config, uint32_t *heapMemoryUsed) {
if (p == NULL) break;
else co->TPDO = (CO_TPDO_t *)p;
mem += sizeof(CO_TPDO_t) * CO_GET_CNT(TPDO);
ON_MULTI_OD(co->CNT_TPDO = config->CNT_TPDO);
ON_MULTI_OD(TX_CNT_TPDO = config->CNT_TPDO);
}
#endif

View file

@ -16,8 +16,8 @@ There are many advantages of sharing the base code such as this. For the driver
3. Add specific driver and other files.
4. Write a good README.md file, where you describe your project, specify demo board, tools used, etc.
5. Optionally prepare a demoDevice in [CANopenDemo](https://github.com/CANopenNode/CANopenDemo) repository and run the tests.
6. Share your work: add description of new device into this file (deviceSupport.md) and make a pull request to CANopenNode. Alternatively create an issue for new device on https://github.com/CANopenNode/CANopenNode/issues.
7. Offer your work for inclusiun under the CANopenNode project and become its developer. It will increase code quality and functionality.
6. Share your work: add description of new device into this file (deviceSupport.md) and make a pull request to CANopenNode. Alternatively create an issue for new device on https://github.com/CANopenNode/CANopenNode/issues.
7. Offer your work for inclusion under the CANopenNode project and become its developer. It will increase code quality and functionality.
Linux