summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-09-29 14:05:50 -0500
committerJeff Epler <jepler@gmail.com>2020-09-29 14:05:50 -0500
commit1bea099eb201526a777f3d30b8a9e017724aaa9d (patch)
treeda55db653f9690bda238361ba7c1132176daf87f /shared-bindings
parent03bd968450fe167db7b7bfcffc98461be850dd5e (diff)
Allow the _state_count properties to be unimplemented
This is the case on the SPI implementations MCP2515 and MCP2518.
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/canio/CAN.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c
index 925b248fa..15ce3dc08 100644
--- a/shared-bindings/canio/CAN.c
+++ b/shared-bindings/canio/CAN.c
@@ -172,7 +172,12 @@ STATIC const mp_obj_property_t canio_can_receive_error_count_obj = {
};
//| error_warning_state_count: int
-//| """The number of times the controller enterted the Error Warning state (read-only). This number wraps around to 0 after an implementation-defined number of errors."""
+//| """The number of times the controller enterted the Error Warning
+//| state (read-only). This number wraps around to 0 after an
+//| implementation-defined number of errors.
+//|
+//| Not all implementations support this property. If the property
+//| is unsupported, AttributeError will be raised."""
//|
STATIC mp_obj_t canio_can_error_warning_state_count_get(mp_obj_t self_in) {
canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -189,7 +194,12 @@ STATIC const mp_obj_property_t canio_can_error_warning_state_count_obj = {
};
//| error_passive_state_count: int
-//| """The number of times the controller enterted the Error Passive state (read-only). This number wraps around to 0 after an implementation-defined number of errors."""
+//| """The number of times the controller enterted the Error Passive
+//| state (read-only). This number wraps around to 0 after an
+//| implementation-defined number of errors.
+//|
+//| Not all implementations support this property. If the property
+//| is unsupported, AttributeError will be raised."""
//|
STATIC mp_obj_t canio_can_error_passive_state_count_get(mp_obj_t self_in) {
canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -206,7 +216,12 @@ STATIC const mp_obj_property_t canio_can_error_passive_state_count_obj = {
};
//| bus_off_state_count: int
-//| """The number of times the controller enterted the Bus Off state (read-only). This number wraps around to 0 after an implementation-defined number of errors."""
+//| """The number of times the controller enterted the Bus Off state
+//| (read-only). This number wraps around to 0 after an
+//| implementation-defined number of errors.
+//|
+//| Not all implementations support this property. If the property
+//| is unsupported, AttributeError will be raised."""
//|
STATIC mp_obj_t canio_can_bus_off_state_count_get(mp_obj_t self_in) {
canio_can_obj_t *self = MP_OBJ_TO_PTR(self_in);