1
0
Fork 0
Commit graph

465 commits

Author SHA1 Message Date
Janez
a528eb1669 Better organised configuration macros (CO_config.h):
- rearranged and better documented
 - default values moved from CO_driver.h into appropriate files
 - rearranged also in CO_driver_target.h files
 - parts of the stack or whole objects can be disabled.
 - configuration is verified for depencies

Additional:
 - renamed some members of CO_Default_CAN_ID_t
 - moved helpers CO_setUint32() etc from CO_SDOserver.h into CO_driver.h.
 - change wrong CO_ERROR_PARAMETERS to CO_ERROR_ILLEGAL_ARGUMENT.
 - renamed CO_ERROR_PARAMETERS to CO_ERROR_OD_PARAMETERS
2020-09-14 15:50:21 +02:00
Carsten Frank
7b66b10dff
Fix lssAddress copy (#221) 2020-08-13 23:57:46 +02:00
Miles Simpson
2c5d685343
Differentiate between SDO_C states so state can be determined in a worker thread when passed a CO_SDOclient_t pointer (#218)
Added #defines for SDO state flags for use by applications

Changed CO_SDO_ST_ABORT to next sequential value
2020-08-11 11:55:12 +02:00
Janez
8783bfff05 use crc16-ccitt.h in CO_fifo.c
It was duplicated.
Commited also some small changes + ODinterface
2020-08-04 23:39:25 +02:00
Miles Simpson
102b503115
Standardized 309 ASCII Gateway newlines to \r\n sequence (#215) 2020-08-04 23:09:51 +02:00
Janez
3fb0a3ee09 Fix compile error with older kernels #211 2020-08-03 07:48:40 +02:00
Janez
2d07d7af17 OD interface: remove "lowLimit" and "highLimit"
Too complicated to implement and litmited usefulness. IO extension is better.
2020-07-25 13:17:01 +02:00
Janez
748086a751 Move enumerator CO_SDOclient_return_t to CO_SDO_return_t
(from CO_SDOclient.h into CO_SDOserver.h)
2020-07-24 10:10:05 +02:00
Janez
1410a20e95 Replace CO_memcpySwap4() 2020-07-23 13:37:50 +02:00
Janez
756c76d08a Added information about XML device description 2020-07-23 07:34:28 +02:00
Norcio
03df5f65b8
fix for missing int cast which cause compilation warning/error when ctype,__cplusplus and esp32 is used (#212)
error: array subscript has type 'char' [-Werror=char-subscripts]
2020-07-22 07:31:56 +02:00
Janez
7903f55ef2 Fixed Gateway timeout for small values (SDO read, write) #209 2020-07-14 16:33:40 +02:00
Janez
f68e9dade7 Fix previous commit 2020-07-14 16:28:32 +02:00
Janez
1f92aee85a SDO: fix broken block download #210
by lukegluke, same as commit in v1.3-master
2020-07-13 15:12:40 +02:00
Janez
d98fb635f5 Added CO_ODinterface 2020-07-13 14:08:16 +02:00
Janez
e79ed1709e Update documentation 2020-07-13 14:07:26 +02:00
Janez
997a311a38 Fixed: delay between gateway commands #208 2020-07-08 13:48:49 +02:00
Janez
035da160b5 SDO: fix to always check if buffer is empty before freeing it #204
Before this patch SDO queue process pointer could overrun receive pointer on receiving NMT stop command during active SDO communication.
This fix is applied to 'master' and 'v1.3-master' branches.
2020-07-01 09:44:18 +02:00
Janez
9dd36aa649 Manual merge #202:
- fix conflicts in CO_SRDO.h and CO_SRDO.c
- Add configs for GFC & SRDO for CO_driver.h and not for socketCAN
- Fix doxygen for CO_gateway_ascii
2020-07-01 09:02:40 +02:00
gotocoffee
3a50bc88c7
SRDO tx & rx extension (#201)
* CANopen Safety (SRDO according to DIN EN 50325-5:2016)

* GFC code and docs

* clang-format on GFC

* SRDO tx and rx extension
added CANopen Safety to README.md
allow manual SRDO transmit
some minor bug fixes

Co-authored-by: rg1 <r.gruening@miunske.com>
2020-06-30 19:17:55 +02:00
Freddie Chopin
3cf4f62109 Completely disable CO_gateway_ascii module if not enabled by config
When CO_CONFIG_GTW_ASCII is not enabled in configuration, this module
produces multiple important warnings, like 2 warnings about implicit
function declaration. Instead of making the source more complex and
fixing each warning individually, in this case it is much easier to just
completely disable compilation of the whole thing.
2020-06-26 12:35:46 +02:00
Freddie Chopin
3fbaec1d5e Add configs for GFC & SRDO for socketCAN, otherwise the test build fails
Default "make" for CANopenNode would fail with an error, because for
socketCAN CO_CONFIG_SRDO_MINIMUM_DELAY was not defined.
2020-06-26 12:09:37 +02:00
Freddie Chopin
19bf4a7fd5 Fix warnings about unused arguments and variables in CO_GFC.c 2020-06-26 12:03:18 +02:00
Freddie Chopin
6da668fc7e Fix whitespace issues in CO_SRDO.c and CO_SRDO.h 2020-06-26 11:58:19 +02:00
Freddie Chopin
7c13199a1a Fix all possible warnings about unused timerNext_us argument 2020-06-26 11:56:46 +02:00
gotocoffee
0f7b3e2d17
CANopen Safety (SRDO according to DIN EN 50325-5:2016) (#196)
* CANopen Safety (SRDO according to DIN EN 50325-5:2016)

* GFC code and docs

* clang-format on GFC

Co-authored-by: rg1 <r.gruening@miunske.com>
2020-06-22 10:14:14 +02:00
Janez
aed6a472d4 LSS led flickering fix. 2020-06-14 12:35:42 +02:00
Janez
ca452c47cc CO_driver interface: remove Emergency object dependency for reporting CAN
errors, use CANerrorStatus own variable instead. Emergency object updated.
2020-06-13 14:06:35 +02:00
Janez
e1c7e2dbfa Add fifo queue for SDO received messages to fix possible drops
Same as pr #174 in v1.3-master
2020-06-11 10:33:03 +02:00
Janez
9ab7ce19ca Merge branch 'master' of https://github.com/CANopenNode/CANopenNode 2020-06-10 09:14:51 +02:00
Janez
35854fd6a0 CO_trace: fix warning "cast increases required alignment of target type"
Same as #193 in v1.3-master
2020-06-10 09:13:49 +02:00
Paolo Teti
6551233406
GCC 10: Fix dereference of NULL warning (#191)
GCC 10 static analyzer (-fanalyzer) warn about possible dereference
of NULL ‘ext’ on 'ext->pODFunc'.

This patch adds a guard on 'ext' to fix the issue.
2020-06-09 17:11:09 +02:00
Janez
dd1677b5bc Integrate LSS slave into CANopenNode more directly.
- CO_LSSslave: move expensive code from CAN receive (interrupt) to mainline
  CO_LSSslave_process() function.
- LSS slave now runs in parallel to other CANopen objects.
- LSS slave and master can run both on same device.
- LSS slave, LSS master and gateway-ascii(CiA309) LSS functions tested.
- LSSusage.md updated.
2020-06-09 14:55:07 +02:00
Janez
ae1b66e6ea Gateway - command interface: update help strings, add status LED indication 2020-06-06 08:07:26 +02:00
Janez
bd3326fed9 Make own file for CANopen status LED diodesLED indicator indication
(CiA303-3) moved from NMT into own files. Now fully comply to standard.
2020-06-05 18:02:26 +02:00
Janez
229b5c5fd3 Change optional arguments in CO_RPDO_init(), CO_TPDO_init(), CO_GTWA_init() 2020-05-31 22:08:36 +02:00
Janez
92a803f169 Add LSS master into gateway-ascii (CiA309).
- Rename local variable 'token' into 'tok' in CO_GTWA_process().
- CO_LSSmaster: replace CO_LSSmaster_InquireNodeId() with more generic
  CO_LSSmaster_Inquire(). CiA309-3 command 'lss_inquire_addr' now works
  also according to standard.
- CANopen.h: fix doxygen.
- gettingStarted.md: Change example "master" device from node-Id=3 to 1...
2020-05-31 14:31:30 +02:00
Janez
ae220f9115 Configuration for LSS updated. 2020-05-29 09:56:05 +02:00
Janez
cb9b2cce42 Add printout of message log from CANopen gateway-ascii (non-standard). 2020-05-29 07:36:23 +02:00
Janez
f41069561a Make SDO client and NMT master optional in gateway_ascii 2020-05-28 16:40:21 +02:00
Janez
ecce574965 fix according to standard:
- There is no white space between the “ERROR:” string and the <error-code> value.
- non-case-sensitive ASCII strings
2020-05-28 09:38:30 +02:00
Paolo Teti
6db813a998
TIME: fix round up conversion from usec to msec (#189)
Use standard idiom for integer rounding up.

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2020-05-27 13:48:16 +02:00
Paolo Teti
6c16680d02
Use memcpy() and memset() where possible (#188)
* LLSMaster: replace explicit array element copy with memcpy()

Replace explicit array element copy with memcpy()

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>

* SDO server: copy and zeroize arrays using memcpy() and memset()

* Replace array elements copy with memcpy().
* Clear response buffer using memset()

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2020-05-27 13:42:50 +02:00
Janez
c1a30b8a03 Some style corrections
- add CO_fifo_st enumerator for use in CO_fifo_cpyTok2xx functions.
- 309/CO_gateway_ascii: add x8 to x64 nonstandard data types
- example compiles now
- Fix "unused argument" warnings in socketCAN
2020-05-15 15:52:22 +02:00
Freddie Chopin
288f8c603f
Fix fifo include (#184)
* Include CO_fifo.h in CO_SDOclient.h in all cases

Struct CO_SDOclient_t has CO_fifo_t member no matter what configuration
is set, so the header is always required. Without this change the build
fails when CO_CONFIG_SDO_CLI_SEGMENTED is not enabled.

* Fix minor copy-paste errors in CO_config.h comments
2020-05-14 16:24:04 +02:00
Freddie Chopin
d272934647
Fix new -Wextra warnings (#185)
* Fix new "unused argument" warnings

* Fix "variable may be used uninitialized" in CO_process_SYNC()

With enabled optimization compiler reports:

CANopen.c: In function ‘CO_process_SYNC’:
CANopen.c:890:12: warning: ‘syncWas’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
  890 |     return syncWas;
      |            ^~~~~~~
2020-05-14 16:23:02 +02:00
Janez
3c6a197650 Update readme 2020-05-12 18:35:23 +02:00
Janez
b5bfeec42a Added CANopen gateway-ascii command interface according to CiA309-3 as a
microcontroller independent module.
It includes NMT master, LSS master and SDO client interface.
Interface is non-blocking, it is added to mainline.
Example for Linux stdio and socket is included.

Added CO_fifo.h/c for fifo data buffer, used with rewritten SDO client, etc

SDO client is rewritten. Now includes r/w fifo interface to transfer data.

doc/gettingStarted.md is updated.
2020-05-12 18:11:43 +02:00
Paolo Teti
61fc785fab
CO_SYNC_process: use enums instead of uint8_t (#182)
Replace hard-coded values with enums and explicit manage all enumeration
values in CO_process_SYNC() to avoid warnings like this:

CANopen.c:837:5: warning: enumeration value ‘CO_SYNC_NONE’ not handled in switch [-Wswitch]
  837 |     switch (sync_process) {
      |     ^~~~~~
2020-05-12 17:35:16 +02:00
Janez
d9c16ae763
Merge pull request #183 from DISTORTEC/even-moar-callbacks
Add CO_TIME_initCallbackPre(), convert {T,R}PDO_CALLS_EXTENSION to config options
2020-05-12 17:30:59 +02:00