1
0
Fork 0
Commit graph

184 commits

Author SHA1 Message Date
Martin Wagner
691c8095b2 heartbeat consumer: added callback for first received heartbeat
This callback is called when the first heartbeat is received (after BOOTUP)
and when there was a pause between heartbeats (TIMEOUT). This allows
the user to get an event when a bus segment is disconnected and then
reconnected from the server (nodes just start sending heartbeats again
without BOOTUP first).
2018-12-14 09:06:39 +01:00
Martin Wagner
5743e1c998 hb consumer: added query function for current NMT state...
this only works on monitored nodes!
2018-12-14 09:06:16 +01:00
Martin Wagner
9c7faddd32 nmt: delete double declaration 2018-12-14 09:06:07 +01:00
Martin Wagner
54f80b119b LSS slave: LSS startup did not confirm to CiA DSP 305 Figure 47
Added function and changed example code so that NMT boot-up is only started
after receiving LSS switch state global waiting. This also fixes problems
where doing CANopenNode initialization (-> change can HW Filter settings)
lead to missing the LSS switch state global waiting message.

However, now we do not fully comply to the specified sequence in 8.3.1.2
as we do all the startup stuff after switching to LSS waiting. This can't
be split in CANopenNode.
2018-12-14 09:04:49 +01:00
Martin Wagner
8ba7084fb7 fixed null pointer dereference
timerNext_ms is given from user and can be null.
2018-10-09 07:49:03 +02:00
Martin Wagner
ac0b82be35 lss master: Deselect all work in all states and cleans up the master state machine 2018-10-09 07:48:41 +02:00
Martin Wagner
65161afb7f heartbeat consumer: initialization of single consumer is now possible from within code 2018-10-09 07:48:31 +02:00
Martin Wagner
1a85de0bec hearbeat consumer: bootup callback was only called when a heartbeat was received before 2018-10-01 15:13:41 +02:00
Martin Wagner
37c2c4230a sdo master: callback for local OD is not triggered by message rx, so trigger it manually 2018-10-01 15:13:33 +02:00
Martin Wagner
13068f6e44 fixed uninitialized variable 2018-10-01 15:13:15 +02:00
Martin Wagner
cf8d0978c9 sdo: added out-of-bound check to getDataPointer 2018-10-01 15:13:05 +02:00
Martin Wagner
11ef04f828 sdo master: fix missing break, fix typo...
no functional changes
2018-09-13 09:13:13 +02:00
Martin Wagner
94b3eac941 sdo client: use SDO client parameter default entries as start values
to keep current behaviour (auto configuration), just set the default values to "0"
2018-09-13 09:12:48 +02:00
Martin Wagner
0860923e9c Revert "Fix switch case fallthrough warnings"
this commit breaks TPDO generation

This reverts commit c236b455d1.
2018-09-10 14:30:00 +02:00
Martin Wagner
7b8756fcc5 heartbeat consumer: added callback functions for each consumer...
example usage: ASCII heartbeat consumer/event protocol
2018-09-10 14:29:52 +02:00
Martin Wagner
36ca8ae0a8 heartbeat consumer: added query functions, fixed emergencies...
HB emergency was only set but never cleared, so only the first error ever
was reported. We now get an emergency when the first node is missing and
a clear emergency when the last node turns up again.
The same applies for HB Remote Reset, however while clearing this emergency
is required by the CO_Emergency module, it's not required for the network.
2018-09-10 14:29:42 +02:00
Martin Wagner
b5534e32c4 lost one line somewhere in merging 2018-09-05 10:50:35 +02:00
Gerlando Falauto
bb17f698b5 lssmaster: allow configuration of nodeId 255 in global mode
Allow LSS configure node to also run in global mode, but only to
set node ID to 255 (0xFF), i.e. to remove configuration.
This way we can easily un-configure all nodes and start all over
with e.g. fastscan.
2018-09-05 10:04:27 +02:00
Gerlando Falauto
bbea9de3ad lssmaster: let inquiry functions run also when in global mode
LSS has two selection modes: global (all nodes) and selective
(just one).
The current implementation defensively refuses to perform some
operations in global mode which are potentially disruptive
(e.g. set node id).
However, reading the node ID and/or LSS identity should not
be dangerous at all since in some cases it might be useful
to just read the identity of a single connected node.
Not quite sure what the behavior with multiple nodes will
be though, since it's theoretically possible to get inconsistent
results by mixing up answers from different nodes.
2018-09-05 10:03:40 +02:00
Gerlando Falauto
c6f2cc6f07 LSSmaster: remove warning 2018-09-05 10:03:18 +02:00
Gerlando Falauto
a67f5b4a22 lss: implement LED logic
We would like a simple way to give feedback when LSS
is involved. Particularly, we would like to identify
a node that is not configured (factory settings), or
that is currently being configured.
Implement a special logic, which can be used to override
the standard LED behavior if your device does not have
a dedicated LED. After all, LSS can be seen as a
maintenance mode so it can be acceptable to deviate
from the standard.
2018-09-05 10:02:28 +02:00
Olivier Desenfans
a3bad0e1fe Fix useless comparison
Fix warning from -Wtype-limits.
Removed a (uint8_t <= 255) comparison.
2018-09-05 09:52:39 +02:00
Martin Wagner
4a1fe12344 Merge remote-tracking branch 'odesenfans/CANopenNode/fix-warnings-sign-compare' into neuberger-master 2018-09-05 09:51:43 +02:00
Martin Wagner
78d55c6f5f Merge remote-tracking branch 'odesenfans/CANopenNode/fix-warnings-fallthrough' into neuberger-master 2018-09-05 09:51:28 +02:00
JuPrgn
73be1f8afc
Fix CO_FSYS -> CO_FCY 2018-09-05 09:48:38 +02:00
Martin Wagner
8512fec801 Merge branch 'add-lss' into neuberger-master 2018-09-05 08:34:21 +02:00
Martin Wagner
822a27aa45 Merge branch 'add-errorregister-mnf-bit' into neuberger-master 2018-09-05 08:34:13 +02:00
Martin Wagner
d189532337 Merge branch 'fix-emcy-timing' into neuberger-master 2018-09-05 08:33:30 +02:00
Martin Wagner
2eac9dd10c Merge branch 'memory-sync' into neuberger-master 2018-09-05 08:33:11 +02:00
Martin Wagner
8ac86884ca Merge branch 'fix-RPDO_CALLS_EXTENSION' into neuberger-master 2018-09-05 08:33:06 +02:00
Martin Wagner
0af8fbac59 Fix build with gcc 2018-09-05 08:23:49 +02:00
gotocoffee
680caf3125 - changed unnamed struct CO_LSS_address_t
- added missing support for big endian in LSSslave
2018-05-02 12:55:44 +02:00
Olivier Desenfans
2dceaa1853 Fix signed/unsigned comparisons
Fix warning from -Wsign-compare.
2018-04-12 17:18:15 +02:00
Olivier Desenfans
c236b455d1 Fix switch case fallthrough warnings
Fix warnings from -Wimplicit-fallthrough.

Changed the implementation of CO_TPDOisCOS to avoid fallthrough.
Added documentation for case fallthroughs that are voluntary.
2018-04-12 17:11:46 +02:00
Martin Wagner
360170cb70 enhanced emergency processing...
- emergency processing now affects CO_process() timerNext_ms
- timerNext_ms is gets set when either a message is ready to send, but inhibit time is not elapsed or when a message was sent to re-check the queue
- be aware that timer resolution is 1ms, whereas emergency inhibit time resolution is 100us. We round this up to the next ms.
2018-03-26 11:16:53 +02:00
Martin Wagner
efc252ab11 manufacturer bit in error register didn't work
if profile is implemented this needs to be separated in more detail to also set profile bit
2018-03-22 09:18:19 +01:00
Wilkins White
b6688f4bc8 Switched to 16 bit identifier 2017-12-06 11:29:54 -08:00
Wilkins White
ecc4056bb4 Expanded info passed through Emergency callback 2017-11-29 10:48:03 -08:00
Wilkins White
ee9d809d0f Expanded Emergency callback to take action when an emergency message is received. 2017-11-29 09:30:51 -08:00
Martin Wagner
1755df7814 memory barrier doesn't work with inline functions...
needs pointer to pointer then
2017-09-05 10:48:34 +02:00
Martin Wagner
6307931275 fix missing semicolon 2017-09-01 14:00:11 +02:00
Martin Wagner
2439d1abf3 Added memory barrier to all objects 2017-09-01 13:45:34 +02:00
Martin Wagner
17676495ac Moved RPDO_CALLS_EXTENSION functionallity out of receive poll loop...
the loop is there because the received data can be overwritten while copying. Calling a callback with potenially half-valid data is a bad idea.
2017-09-01 10:35:24 +02:00
Martin Wagner
e3bed95204 Fixed SDO read/write callback race condition...
with multithreading applications it was possible to modify entries in between calling OD function and copying to/from sdo buffer
2017-09-01 10:34:01 +02:00
iurly
5338015740 CO_trace: remove compiler warnings (#49)
snprintf() calls will raise warnings when using %u/%d
format strings with uint32_t/int32_t arguments.
Use %lu/%ld instead.
2017-08-01 17:19:52 +02:00
Martin Wagner
006b71e19d Added LSS fastscan master/slave
- other limitations still apply
2017-07-13 09:34:10 +02:00
Janez
dee8503da0 SDO block transfer issue #39 2017-07-04 15:07:38 +02:00
Janez
78ce0fd55d Merge branch 'fix-invalid-access' of https://github.com/martinwag/CANopenNode into martinwag-fix-invalid-access 2017-07-04 14:11:13 +02:00
Janez
96a5858a19 Merge branch 'fix-testcase-pdo23_24_25' of https://github.com/martinwag/CANopenNode into martinwag-fix-testcase-pdo23_24_25 2017-07-04 13:50:08 +02:00
Janez
dc390f0fd2 return CO_SDO_AB_INVALID_VALUE for wrong value on object 1019 (SYNC) 2017-07-04 13:22:18 +02:00
Janez
9acf0d3ad3 Merge branch 'fix-testcase-sync05' of https://github.com/martinwag/CANopenNode into martinwag-fix-testcase-sync05 2017-07-04 13:09:40 +02:00
Janez
ba07ad763d Merge branch 'fix-testcase-sdo26_2' of https://github.com/martinwag/CANopenNode into martinwag-fix-testcase-sdo26_2 2017-07-04 13:00:36 +02:00
Janez
6acf18da5b Merge branch 'fix-testcase-sdo27' of https://github.com/martinwag/CANopenNode into martinwag-fix-testcase-sdo27 2017-07-04 12:53:49 +02:00
Martin Wagner
9dbd2fc966 First try on LSS master addon...
- needs #define CO_NO_LSS_CLIENT 1 in CO_OD.h. This will need a change in the OD editor.
- still no fastscan support
- bitrate settin API untested
- some changes on LSS slave where necessary
2017-07-03 11:14:07 +02:00
Martin Wagner
03982ad8e3 First try on LSS slave addon...
- needs #define CO_NO_LSS_SERVER 1 in CO_OD.h. This will need a change in the OD editor.
- no Fastscan support yet
- bitrate setting API untested
- https://github.com/CANopenNode/CANopenNode/issues/46 (driver stuff)
- changed some of the other stack files, tried my best to remain compatible with standard non LSS CANopenNode
2017-06-26 13:04:02 +02:00
Martin Wagner
f9a913e3e1 PDO dummy mapping caused invalid memory access 2017-06-02 14:39:04 +02:00
Martin Wagner
9fa1787441 write invalid PDO mapping error codes...
according to DSP310, those values should be returned (Page 28, 29).  There's nothing about this error behavior in CiA301, this only describes value errors, but not sequence errors in mapping change.
2017-05-29 14:55:32 +02:00
Martin Wagner
f04bc1bb31 SYNC write OD 0x1019 add value check...
according to DSP310, when writing a "reserved" value to this index, a error response should be created (page 39). There's nothing about this behavior in CiA301.
2017-05-23 15:19:54 +02:00
Martin Wagner
33e2c91850 SDO upload block initiate invalid block size created abort message...
instead of invalid block size error. Fixes CANopen conformance test tool test case SDO 26
2017-05-23 10:51:10 +02:00
Martin Wagner
a07726fa31 SDO upload block invalid sequence generated block size error...
instead of invalid sequence error. Fixes CANopen conformance test tool test case SDO 27
2017-05-23 10:15:01 +02:00
Martin Wagner
467ad78047 OD 1003-0 now clears errors 2017-05-22 08:49:38 +02:00
CANopenNode
efc6876c1b Merge pull request #37 from martinwag/add-errorbit-defines
Add definition to make application specific error bit macros more clear
2017-05-20 16:56:18 +02:00
CANopenNode
3a4be8eb83 Update CO_NMT_Heartbeat.c 2017-05-20 16:51:11 +02:00
CANopenNode
9c04d69974 Merge branch 'master' into add-nmt-callback 2017-05-20 16:33:17 +02:00
CANopenNode
895e2f6ff4 Merge pull request #35 from martinwag/add-cpp-guards
Added guards for c++ compilation
2017-05-20 16:28:25 +02:00
CANopenNode
43a37e2a7f Merge pull request #34 from martinwag/add-custom-crc
Compiler switch enables providing own CRC16 implemetation.
2017-05-20 16:25:48 +02:00
Martin Wagner
cc0df99b77 Add definition to make application specific error bit macros more clear 2017-05-16 16:05:53 +02:00
Martin Wagner
260cbc55e3 Added callback and query function for NMT state 2017-05-10 15:35:57 +02:00
Martin Wagner
e4eaafd383 Added usage example 2017-05-10 15:31:53 +02:00
Martin Wagner
f023106e5a Added guards for c++ compilation 2017-05-10 15:30:25 +02:00
Martin Wagner
9e6b1c296c Compiler switch enables providing own CRC16 implemetation.
This enables the stack user to use a different calculation method. This
is needed to save space (no table) or to use hardware crc unit.
Implementation can be located in driver directory.
2017-05-10 15:29:08 +02:00
Janez
83f18edc40 Solved: synchronous RPDOs lost #23 2017-02-24 16:12:35 +01:00
Janez
8aa9b452fc Added LPC1768 into readme. 2017-02-03 13:02:36 +01:00
Janez
9f20d6ca6f Cleanup of documentation comments and match stylings. No code change. 2017-02-03 12:58:42 +01:00
Janez
daf98dfb13 Merge branch 'feature/LPC1768_driver' of https://github.com/exmachina-dev/CANopenNode into exmachina-dev-feature/LPC1768_driver 2017-02-03 11:32:25 +01:00
Janez
83b6a7abb4 Make it possible to write to 0x1003 - Pre-Defined Error Field #15 2017-02-03 10:51:23 +01:00
Benoit Rapidel
763303d0bf Add copyright and license information in LPC1768 driver 2016-11-25 20:05:44 +01:00
Benoit Rapidel
656a21d0b9 Add extern call to use C code in CO_driver.cpp 2016-11-25 19:58:58 +01:00
Benoit Rapidel
6833969dcd Add LPC1768 driver using mbed SDK 2016-11-25 19:58:16 +01:00
Janez
5df11b9d74 SYNC timeout bugfix; synchronous PDOs are now processed after next sync. 2016-09-07 16:08:07 +02:00
Janez
2e0a086514 Issue #10: Devices PIC32MX530, 550 and 570 has only 16 receive filters. 2016-07-07 10:12:10 +02:00
Janez
57a900f7b7 Issue #10 fixed: PIC32MX530 has only 16 acceptance filters. (Not 32.) 2016-07-06 11:08:58 +02:00
Janez
851d9e0245 Trace functionality updated. 2016-04-04 14:04:47 +02:00
Janez
614735bc60 CANopenSocket related. 2016-03-29 21:05:16 +02:00
Janez
499111c5b8 Some rearangement in trace. 2016-03-25 17:25:48 +01:00
Janez
1eacd6d675 Trace works on PIC32. 2016-03-24 23:59:52 +01:00
Janez
85fc85482e Added trace interface for monitoring variables. 2016-03-24 22:01:44 +01:00
Janez
b6672b2500 Pull request #8 jensnielsen/CAN RX interrupt 2016-03-21 12:08:34 +01:00
Petteri
bda46127bb Nonvolatile storage for STM32F3-series of microcontrollers 2016-03-15 13:54:28 +02:00
Petteri
0838b6efa3 CANOpenNode driver for STM32F3-series of microcontrollers 2016-03-15 13:53:46 +02:00
Janez
76b79a1a41 Merge branch 'master' of 192.168.1.30:git/CANopenNode 2016-02-15 11:08:07 +01:00
Janez
392abbe4d3 PIC32 2016-02-15 11:07:48 +01:00
Janez
6f2ffda7ba Updated comment in drvTemplate 2016-02-03 11:22:58 +01:00
Janez
934e90e7ec main_PIC32.c bugfix. 2016-01-14 09:28:34 +01:00
Janez
e6db254c63 Added CO->CANmodule[x]->CANnormal to all drivers. example/main.c updated. 2016-01-12 13:48:16 +01:00
Janez
41b8d903b7 License changed to the GNU General Public License version 2 with the classpath exception. 2016-01-10 00:15:50 +01:00
Janez
3e78c3eec5 dsPIC30 works. 2016-01-08 18:31:22 +01:00
Janez
40f329d0f1 Removed plib dependency for PIC32. 2016-01-08 17:56:30 +01:00
Janez
8d0420b432 PIC24, dsPIC33 - EDS and DMA macros changed and moved from CANopen.c to CO_driver.c.
directory PIC24H_dsPIC33F renamed to PIC24_dsPIC33.
https://sourceforge.net/p/canopennode/discussion/387151/thread/281ffd7f
2016-01-07 15:28:49 +01:00
Janez
0bd31f0dc4 Domain data type.
http://sourceforge.net/p/canopennode/discussion/387151/thread/603deb63/
2016-01-06 13:11:48 +01:00