1
0
Fork 0

works also with globals

This commit is contained in:
Janez 2020-10-27 13:13:13 +01:00
parent ee1d8d0c81
commit 8e2de726a5
3 changed files with 15 additions and 14 deletions

View file

@ -721,8 +721,8 @@ void CO_delete(CO_t *co) {
#endif
static CO_t COO;
static CO_CANmodule_t COO_CANmodule;
static CO_CANrx_t COO_CANmodule_rxArray[OD_CNT_ALL_RX_MSGS];
static CO_CANtx_t COO_CANmodule_txArray[OD_CNT_ALL_TX_MSGS];
static CO_CANrx_t COO_CANmodule_rxArray[CO_CNT_ALL_RX_MSGS];
static CO_CANtx_t COO_CANmodule_txArray[CO_CNT_ALL_TX_MSGS];
static CO_NMT_t COO_NMT;
#if (CO_CONFIG_HB_CONS) & CO_CONFIG_HB_CONS_ENABLE
static CO_HBconsumer_t COO_HBcons;

View file

@ -47,11 +47,11 @@ SOURCES = \
OBJS = $(SOURCES:%.c=%.o)
CC ?= gcc
OPT = -g -pedantic
#OPT = -g -pedantic -fanalyzer
#OPT = -g -pedantic -DCO_USE_GLOBALS
#OPT = -g -pedantic -DCO_MULTIPLE_OD
#OPT = -g -pedantic -DCO_SINGLE_THREAD
OPT = -g
#OPT = -g -pedantic -Wshadow -fanalyzer
#OPT = -g -DCO_USE_GLOBALS
#OPT = -g -DCO_MULTIPLE_OD
#OPT = -g -DCO_SINGLE_THREAD
CFLAGS = -Wall $(OPT) $(INCLUDE_DIRS)
LDFLAGS = -pthread
#LDFLAGS =

View file

@ -158,21 +158,22 @@ Please be careful when exposing your CANopen network to the outside world, it is
### Next steps
Now you can enter the big world of [CANopen devices](http://can-newsletter.org/hardware).
You can also build your own CANopen device with your favourite microcontroller, see *deviceSupport.md*. There is also a bare-metal demo for [PIC microcontrollers](https://github.com/CANopenNode/CANopenPIC), most complete example is for PIC32.
Assigning Node-ID or CAN bitrate, which support LSS configuration, is described in *LSSusage.md*.
Some further CANopenNode related Linux tools are available in [CANopenSocket](https://github.com/CANopenNode/CANopenSocket).
Custom CANopen device can be created based on own Object Dictionary. Use *EDSEditor.exe* from https://github.com/robincornelius/libedssharp to generate one. It runs in Linux or Windows. For principles see *objectDictionary.md*. There are also many very useful and high quality specifications for different [device profiles](http://www.can-cia.org/standardization/specifications/), some of them are public and free to download, for example CiA401.
For own CANopen device with own microcontroller, see *deviceSupport.md*. There is a bare-metal demo for [PIC microcontrollers](https://github.com/CANopenNode/CANopenPIC), most complete example is for PIC32.
Another interesting tool is [CANopen for Python](https://github.com/christiansandberg/canopen).
Accessing real CANopen devices is the same as described above for virtual CAN interface. Some tested USB to CAN interfaces, which are native in Linux kernel are:
- Simple serial [USBtin](http://www.fischl.de/usbtin/) - Start with: `sudo slcand -f -o -c -s8 /dev/ttyACM0 can0; sudo ip link set up can0`
- [EMS CPC-USB](https://www.ems-wuensche.com/?post_type=product&p=746) or [PCAN-USB FD](http://www.peak-system.com/PCAN-USB-FD.365.0.html?&L=1) - Start with: `sudo ip link set up can0 type can bitrate 250000`
- You can get the idea of other supported CAN interfaces in [Linux kernel source](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/net/can) (Kconfig files).
- Raspberry PI or similar has CAN capes available.
With [CANopenNode](https://github.com/CANopenNode/CANopenNode) you can also design your own device. There are many very useful and high quality specifications for different [device profiles](http://www.can-cia.org/standardization/specifications/), some of them are public and free to download.
Now you can enter the big world of [CANopen devices](http://can-newsletter.org/hardware).
Here we played with virtual CAN interface and result shows as pixels on screen. If you connect real CAN interface to your computer, things may
become dangerous. Keep control and safety on your machines!
Here we played with virtual CAN interface and result shown as pixels on screen. If you connect a real CAN interface to your computer, things may become dangerous. Keep control and safety on your machines!