summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-09-16 12:07:15 -0500
committerJeff Epler <jepler@gmail.com>2020-09-21 16:44:26 -0500
commit1eb0587917f54aec07104b00f7dd6f3f0b9cf201 (patch)
treef12b018e3beed731d8ff0877d6887210c06b82fe
parent635fcadb59fdba47d1628c3abff1b9bfc890a5d5 (diff)
correct docstring
-rw-r--r--shared-bindings/_canio/Message.c6
-rw-r--r--shared-bindings/_canio/__init__.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c
index a8e588354..f1cd11d8e 100644
--- a/shared-bindings/_canio/Message.c
+++ b/shared-bindings/_canio/Message.c
@@ -115,7 +115,7 @@ STATIC const mp_obj_property_t canio_message_id_obj = {
//| data: bytes
//| """The content of the message, or dummy content in the case of an rtr.
//|
-//| Assigning to data sets the bytes to zero"""
+//| Assigning to data also sets the length."""
//|
STATIC mp_obj_t canio_message_data_get(const mp_obj_t self_in) {
canio_message_obj_t *self = self_in;
@@ -145,7 +145,9 @@ STATIC const mp_obj_property_t canio_message_data_obj = {
//| size: int
-//| """The length of the message, or the length of the requested data in the case of an rtr"""
+//| """The length of the message, or the length of the requested data in the case of an rtr
+//|
+//| Assigning to the length sets all the data bytes to zero"""
//|
STATIC mp_obj_t canio_message_size_get(const mp_obj_t self_in) {
canio_message_obj_t *self = self_in;
diff --git a/shared-bindings/_canio/__init__.c b/shared-bindings/_canio/__init__.c
index 577466ed6..cff675f06 100644
--- a/shared-bindings/_canio/__init__.c
+++ b/shared-bindings/_canio/__init__.c
@@ -29,7 +29,7 @@
//| The `_canio` module contains low level classes to support the CAN bus
//| protocol.
//|
-//| All classes change hardware state and should be deinitialized when they
+//| CAN and Listener classes change hardware state and should be deinitialized when they
//| are no longer needed if the program continues after use. To do so, either
//| call :py:meth:`!deinit` or use a context manager. See
//| :ref:`lifetime-and-contextmanagers` for more info.
@@ -39,12 +39,13 @@
//| import _canio
//| from board import *
//|
-//| can = _canio.BUS(board.CANRX, board.CANTX)
-//| can.write(408, b"adafruit")
+//| can = _canio.CAN(board.CAN_RX, board.CAN_TX, baudrate=1000000)
+//| message = _canio.Message(id=0x0408, data="adafruit"
+//| can.write(message))
//| can.deinit()
//|
//| This example will write the data 'adafruit' onto the CAN bus to any
-//| device listening for message id 408."""
+//| device listening for message id 0x0408."""
//|
#include "py/obj.h"