1
0
Fork 0
Commit graph

53 commits

Author SHA1 Message Date
temi54c1l8
f9d8bdeff3 static analysys: local variable 'data' could be pointer to const [MISRA 2012 Rule 8.13, advisory]
refactory CO_CANrxMsg_readData return const
2024-06-14 11:27:22 +02:00
temi54c1l8
cac0f78b10 CO_LSSslave: static analysis: ANSI/ISO minimum translation limit of 31 'significant characters in an external identifier' exceeded, processing is unaffected 2024-06-14 10:42:39 +02:00
temi54c1l8
42cea36f3b CO_LSSmaster and CO_LSSslave: static analysis: repeated include file 'string.h' 2024-06-14 09:12:52 +02:00
temi54c1l8
284ba1a41f CO_LSSslave: static analysis: remove cast unnecessary 2024-06-14 08:20:26 +02:00
temi54c1l8
6990e11e7f CO_LSSslave: static analysis: an unsigned value and a signed value cannot be used together as operands to - [MISRA 2012 Rule 10.4, required] 2024-06-14 08:13:08 +02:00
temi54c1l8
d4b4d29f0b CO_LSSmaster and CO_LSSslave: static analysis: cannot assign 'enum' to different essential type [MISRA 2012 Rule 10.3, required]
refactoring convert enum to macro
2024-06-14 08:12:08 +02:00
temi54c1l8
47461cf08a CO_LSSmaster: static analysis: cannot assign 'enum' to different essential type [MISRA 2012 Rule 10.3, required]
refactoring convert enum to macro
2024-06-13 16:30:10 +02:00
temi54c1l8
79aa366627 CO_LSSmaster: style changed , add space on if condition 2024-06-13 16:21:12 +02:00
temi54c1l8
22fe7b9bc6 CO_LSSmaster: static analysis: statement or comment should appear in default case [MISRA 2012 Rule 16.1, required], [MISRA 2012 Rule 16.4, required] 2024-06-13 16:12:13 +02:00
temi54c1l8
6ebd390160 CO_LSSmaster: departure from MISRA switch syntax: missing break or throw from switch-case [MISRA 2012 Rule 16.1, required]
refactoring change switch to if condition
2024-06-13 16:10:56 +02:00
temi54c1l8
bad7521985 CO_LSSmaster: static analysis: no 'else' at end of 'if ... else if' chain [MISRA 2012 Rule 15.7, required] 2024-06-13 16:07:28 +02:00
temi54c1l8
5a62e186b9 CO_LSSmaster: static analysis: missing unconditional break from final switch case [MISRA 2012 Rule 16.1, required], [MISRA 2012 Rule 16.3, required] 2024-06-13 16:04:10 +02:00
temi54c1l8
29673b0304 CO_LSSmaster: static analysis: an unsigned value and a signed value cannot be used together as operands [MISRA 2012 Rule 10.4, required] 2024-06-13 15:13:01 +02:00
temi54c1l8
f322d42c2c CO_LSSmaster: static analysis: ignoring return value of function 'CO_LSSmaster_FsScanInitiate' [MISRA 2012 Directive 4.7, required], [MISRA 2012 Rule 17.7, required] 2024-06-13 15:09:30 +02:00
temi54c1l8
f54f919c1c CO_LSSmaster: static analysis: use of modifier or type 'int' outside of a typedef [MISRA 2012 Directive 4.6, advisory] 2024-06-13 15:07:55 +02:00
temi54c1l8
d64f0dcc41 CO_LSSslave: static analysis: taking address of array 2024-06-13 14:50:32 +02:00
temi54c1l8
f1e68448c1 CO_LSSslave: static analysis: unsigned integer literal without a 'U' suffix [MISRA 2012 Rule 7.2, required] 2024-06-13 14:48:23 +02:00
temi54c1l8
cd1f389719 CO_LSSslave: static analysis: cannot assign 'enum' to different essential type [MISRA 2012 Rule 10.3, required] 2024-06-13 14:46:02 +02:00
temi54c1l8
08e7903332 CO_LSSslave: static analysis argument 1 is not compatible with argument 2 in call to function 'memcpy' 2024-06-13 14:41:34 +02:00
temi54c1l8
2d03662a23 CO_LSSslave: static analysis: statement or comment should appear in default case [MISRA 2012 Rule 16.1, required], [MISRA 2012 Rule 16.4, required] 2024-06-13 14:37:28 +02:00
temi54c1l8
6e009c0893 static analysis: cannot assign 'signed8' to different essential type 'boolean' [MISRA 2012 Rule 10.3, required] 2024-06-12 10:42:40 +02:00
temi54c1l8
9e8ceb4dfa static analysis: ignoring return value of functions [MISRA 2012 Directive 4.7, required] 2024-06-12 10:13:45 +02:00
temi54c1l8
d4e7214f4d static analysis: conditional of #if does not evaluate to 0 or 1 [MISRA 2012 Rule 20.8, required] 2024-06-12 09:09:12 +02:00
temi54c1l8
0142f41857 static analysis: an enum value is not an appropriate left operand [MISRA 2012 Rule 10.1, required] 2024-06-10 17:59:05 +02:00
temi54c1l8
446925be63 static analysis: add 'U' of unsigned [MISRA 2012 Rule 10.4, required] 2024-06-10 17:57:42 +02:00
temi54c1l8
dc10900ad5 static analysis: Aggiunte parentesi per la dipendenza posta sulla precedenza dell'operatore [MISRA 2012 Rule 12.1, advisory] 2024-06-10 14:39:05 +02:00
temi54c1l8
a17b9fa209 static analysis: Ignoring return value of functions: CO_setUint8, CO_setUint16, CO_setUint32 [MISRA 2012 Directive 4.7, required] 2024-06-10 12:07:41 +02:00
temi54c1l8
e3206f2c7f static analysis: Ignoring return value of function 'memset' [MISRA 2012 Directive 4.7, required] 2024-06-10 11:56:47 +02:00
temi54c1l8
ddaa8974f1 static analysis: Ignoring return value of function 'memcpy' [MISRA 2012 Directive 4.7, required] 2024-06-10 10:30:59 +02:00
Janez
39fc9212e6 Fixed Compiler warnings, issue #512 2024-04-25 16:51:37 +02:00
Brian Linari
a52db428f6
Misra (#501)
Make MISRA compliant for:
MISRA C 2004 rule 14.10
MISRA C 2004 rule 14.9
MISRA C 2004 rule 13.1
MISRA C 2004 rule 15.3

MISRA style guild update
2024-03-13 17:20:42 +01:00
Janez
1ee6a9abc2 Move some macros from CO_LSS.h into CO_LSSslave.c, issue #301 2021-07-01 09:23:39 +02:00
Janez
f56c96db3c Documentation arrangement according to doxygen.
- Minor changes in most files
- add CANopenNode.png
- update doxyfile
- move doc/LSSusage.md and doc/gettingStarted.md into CANopenDemo repository
- update README.md
2021-05-17 13:29:13 +02:00
gotocoffee1
591a91be29 fixed some warnings
fixed some small bugs
2021-04-27 16:24:00 +02:00
Janez
49f7c80114 Heartbeat consumer updated to newOD 2021-01-30 14:40:27 +01:00
Janez
8cff68f196 CO_config.h: use global macros for common definitions 2021-01-25 21:32:51 +01:00
Janez
267a2dafb2 Replace type char with uint8_t or int8_t, where appropriate
305/CO_LSS.h now passing -Wextra warnings
2021-01-05 09:22:19 +01:00
Janez
5a7520d36d Reduce scope of local variables to avoid warning about shadowing, #241 2020-10-26 18:18:11 +01:00
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
Janez
1410a20e95 Replace CO_memcpySwap4() 2020-07-23 13:37:50 +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
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
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
Freddie Chopin
e88ecb894e Fix "unused parameter" warnings
Some functions have a signature required by API, thus they have
arguments which will be unused. Fix by casting to void.
2020-05-06 16:31:36 +02:00
Freddie Chopin
4c3011d34a
Replace all memcpy/memset-like functions with standard <string.h> functions (#175)
* Use standard memcpy() instead of CO_memcpy()

* Remove CO_memcpy()

* Use standard memset() instead of CO_memset()

* Remove CO_memset()

* Move helper functions from CO_SDOserver.c to header and make them inline

* Implement CO_getUint16() with memcpy()

* Implement CO_getUint32() with memcpy()

* Implement CO_setUint16() with memcpy()

* Implement CO_setUint32() with memcpy()

* Define memcpy() as CO_memcpySwapX() for little-endian systems

* Fix several writes past the buffer due to hardcoded sizes

Use more "generic" sizes (via sizeof()) instead of hardcoded number in
all calls to memset() to avoid 1-byte errors which result in writes past
the buffer, for example:

memset(&LSSslave->TXbuff->data[5], 0, 4);
in CO_LSSslave_serviceInquire()

memset(&LSSmaster->TXbuff->data[6], 0, 3);
in CO_LSSmaster_switchStateSelectInitiate()

* Use "generic" size in calls to memcpy() where possible

* Remove CO_bytes_t

This type was used only for CO_{get,set}Uint{16,32}().
2020-05-04 11:22:32 +02:00
Janez
43f86073ee Minor corrections in documentation. 2020-04-03 11:43:14 +02:00
Janez
c88194e813 Add Stack configuration macros to most of CANopenNode objects.
Add CO_NMT_initCallbackPre()
2020-03-19 18:07:23 +01:00
Janez
d9c44c69d1 Change non-descriptive CO_***_initCallback() into CO_***_initCallbackPre().
Change CO_NMT_initCallback() into CO_NMT_initCallbackChange().
Change type of NMT->operatingState from uint8_t into enum CO_NMT_internalState_t.
2020-03-18 23:19:29 +01:00