Commit graph

13 commits

Author SHA1 Message Date
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Alexander Wachter 464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Peter Bigot 842c42d7f0 documentation: fix wrong recommendation for millisecond timeouts
API documentation for parameters that accept a duration specified in
milliseconds is updated to replace references to K_NO_WAIT with 0, and
K_FOREVER with SYS_FOREVER_MS.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-30 18:26:26 +02:00
Corey Wharton 86bfc489f4 scripts: Replace hard-coded subsystem list with __subsystem annotations.
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-03-11 17:13:39 +02:00
Peter A. Bigot 8328159b09 include: respect line limit in api pointer initialization
The automated process used to remove implicit casts resulted in code
that exceeded the documented line length limits.  Break the assignment
into two lines where this happened.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-16 21:14:08 -05:00
Peter A. Bigot 2e358f11d0 include/drivers: remove implicit casts from api pointer initialization
C++ disallows implicit cast of void pointers to a non-void pointer
type.  Presence of implicit casts prevents use of these headers in C++
applications.

Process: Run the following coccinelle script:

@@
identifier V;
identifier TAG =~ "driver_api";
type T;
expression E;
@@
 T* V =
+(T *)
 E->TAG;

in this command line from $ZEPHYR_BASE:

spatch --sp-file expcast.cocci \
   --include-headers --dir include/ --very-quiet \
 | sed -e '/^\+/s@\*) @*)@' \
 | (cd include/ ; patch -p1)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-15 10:18:17 -05:00
Alexander Wachter d558fd055a drivers: CAN: Limit the DLC to 8
This commit limits the data length code to eight.
DLC > 8 returns a newly introduced CAN_TX_EINVAL error code.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-11-06 21:00:45 +01:00
David B. Kinder 73896c0bf0 doc: fix misspelling in API doxygen comments
Fix misspellings in API doxygen comments missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-29 06:00:14 +01:00
Alexander Wachter 30ebf52a27 include: drivers: can: Fix zframe to frame conversion
can_copy_zframe_to_frame did not distinguish between the standard and
extended frames. As a result, uninitialized bits were copied to the
destination frame. This commit changes the function to use the correct
bitfields.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 21:51:40 +03:00
Alexander Wachter c0da8a7901 drivers: can: Extend CAN API for bus-state management.
This commit extends the CAN API with the following functions:
- can_get_state
- can_recover
- can_register_state_change_isr

This functions can be used to get the error-counters and the state
of the CAN controller. The recover function can be used to recover
from bus-off state when automatic recovery is disabled.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-24 12:28:01 +03:00
Alexander Wachter 1c7892df3f include: drivers: CAN: changed return parameter description
Changed return parameter description from
"@retval filter id on success"  to
"@retval filter_id on success".
This change suppresses the doxy warnings.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-10-04 13:05:44 -04:00
Alexander Wachter 3febaad1d6 can: Add RX timestamp to zcan_frame
This commit introduces a timestamp for received CAN frames.
The timestamp is optional and can be activated via Kconfig.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-08-06 16:39:35 +03:00
Anas Nashif c0c9396d44 cleanup: include/: move can.h to drivers/can.h
move can.h to drivers/can.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00