1
0
Fork 0
Commit graph

172 commits

Author SHA1 Message Date
Martin Wagner
e336b3ad26 Changed for two callbacks, as one is called inside ISR context. This also keeps backward compatibility for current useres that don't need RX EMCY events 2019-10-08 10:17:03 +02:00
Martin Wagner
fa5f81e0a9 Merge branch 'master' of https://github.com/wilkinsw/CANopenNode 2019-10-08 10:01:50 +02:00
Martin Wagner
8b01062eb6 Merge branch 'martinwag-neuberger-master' 2019-10-08 08:28:29 +02:00
Martin Wagner
0bd08bef1a
Merge branch 'master' into neuberger-master 2019-10-08 08:25:37 +02:00
Martin Wagner
d200264301 Merge branch 'martinwag-fix-emcy-overflow-clear' 2019-10-08 08:07:33 +02:00
Martin Wagner
8d565f7fbc Merge branch 'fix-emcy-overflow-clear' of https://github.com/martinwag/CANopenNode into martinwag-fix-emcy-overflow-clear 2019-10-08 08:07:26 +02:00
Martin Wagner
8a766530d2 Merge branch 'martinwag-add-errorregister-mnf-bit' 2019-10-08 08:06:47 +02:00
Martin Wagner
8d1955ab6d Merge branch 'add-errorregister-mnf-bit' of https://github.com/martinwag/CANopenNode into martinwag-add-errorregister-mnf-bit 2019-10-08 08:06:21 +02:00
Martin Wagner
6ef8ffcf0f Merge branch 'martinwag-fix-sdo-race-condition' 2019-10-08 08:01:58 +02:00
Martin Wagner
14c2abd582 Merge branch 'fix-sdo-race-condition' of https://github.com/martinwag/CANopenNode into martinwag-fix-sdo-race-condition 2019-10-08 08:01:40 +02:00
Martin Wagner
b06254257e Merge branch 'martinwag-fix-RPDO_CALLS_EXTENSION' 2019-10-08 08:00:01 +02:00
Martin Wagner
c46a2edd57 Add Linux socketCAN driver for CANopen manager application
This driver is more sophisticated than the normal socketCAN driver. Compared
to the normal socketCAN driver, this one contains the linking exception license.

Changes compared to normal socketCAN driver:
- Re-implementation based on driver template
- Error detection works
- Setting up filters works properly
- Optional Support for socketCAN error frames. This currently handles bus-off
  and no-ack condition by setting driver into listen-only mode. If you decide
  to use this feature have a close look at your own requirements and fit
  error handling functions to that.
- Optional support for CAN interface combining (not redundancy!). With this
  feature enabled you can have multiple CAN interface represented as one within
  CANopenNode stack. By default, all TX messages are sent on all used CAN
  interfaces, but the user can change this behaviour inside own app (e.g. check
  on wich bus rx-sdo is received and set-up tx-sdo accordingly).
  Be aware that no bridging between the interfaces is done!
2019-05-10 09:52:11 +02:00
Martin Wagner
cf02f924ff Fix: Use getter function instead of raw pointer...
see https://github.com/CANopenNode/CANopenNode/issues/100

Using this workaround, the struct passed to the callback still doesn't
match the description (only "data" is passed instead of "data" and
"ODdataStorage"), see CO_ODF_arg_t fields description for details.

However, data pointer is a least valid for all object types.
2019-05-10 09:35:37 +02:00
Martin Wagner
817ddcb786 Revert "nmt: delete double declaration"
This reverts commit 9c7faddd32.
2018-12-14 09:13:26 +01:00
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
5601770589 Changed sdo client to support multiple sdo servers.
for existing code, you need to add "[0]" to the sdo function parameter CO->SDOclient (so you get CO->SDOclient[0]).
2018-09-13 09:12:21 +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
Benoit Rapidel
c0ec1da5ef CO_sendNMTcommand must return a CO_ReturnError_t, not a uint16_t 2018-09-05 09:10:15 +02:00
Martin Wagner
2a0ec4437c fixed build after adding lss
modified the example code to exclude lss. be aware that the CANopenNode html editor doesn't now about those flags!
2018-09-05 08: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
71072b7bdd Merge branch 'fix-emcy-overflow-clear' into neuberger-master 2018-09-05 08:34:05 +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
Martin Wagner
d5e31d6e06 lss init return value was ignored 2018-09-05 08:23:03 +02:00
Martin Wagner
8bad7d2e29
Merge pull request #2 from gotocoffee1/add-lss
forgot to change CANopen.c
2018-05-03 07:37:54 +02:00