correct docstring

This commit is contained in:
Jeff Epler 2020-09-16 12:07:15 -05:00
parent 635fcadb59
commit 1eb0587917
2 changed files with 9 additions and 6 deletions

View File

@ -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;

View File

@ -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"