From 1eb0587917f54aec07104b00f7dd6f3f0b9cf201 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 16 Sep 2020 12:07:15 -0500 Subject: [PATCH] correct docstring --- shared-bindings/_canio/Message.c | 6 ++++-- shared-bindings/_canio/__init__.c | 9 +++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/shared-bindings/_canio/Message.c b/shared-bindings/_canio/Message.c index a8e5883541..f1cd11d8ec 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 577466ed61..cff675f069 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"