Whitespace
This commit is contained in:
parent
58b920ed97
commit
a69b298aed
@ -298,7 +298,7 @@ STATIC mp_obj_t canio_can_listen(size_t n_args, const mp_obj_t *pos_args, mp_map
|
||||
canio_match_obj_t *matches[nmatch];
|
||||
for (size_t i=0; i<nmatch; i++) {
|
||||
mp_obj_type_t *type = mp_obj_get_type(match_objects[i]);
|
||||
if(type != &canio_match_type) {
|
||||
if (type != &canio_match_type) {
|
||||
mp_raise_TypeError_varg(translate("expected '%q' but got '%q'"), MP_QSTR_Match, type->name);
|
||||
}
|
||||
matches[i] = MP_OBJ_TO_PTR(match_objects[i]);
|
||||
|
@ -112,7 +112,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_iter_obj, canio_listener_iter);
|
||||
STATIC mp_obj_t canio_listener_next(mp_obj_t self_in) {
|
||||
canio_listener_obj_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
common_hal_canio_listener_check_for_deinit(self);
|
||||
if(common_hal_canio_listener_in_waiting(self)) {
|
||||
if (common_hal_canio_listener_in_waiting(self)) {
|
||||
return canio_listener_read(self_in);
|
||||
}
|
||||
return self;
|
||||
|
@ -59,11 +59,11 @@ STATIC mp_obj_t canio_match_make_new(const mp_obj_type_t *type, size_t n_args, c
|
||||
int address = args[ARG_address].u_int;
|
||||
int mask = args[ARG_mask].u_int;
|
||||
|
||||
if(address & ~address_bits) {
|
||||
if (address & ~address_bits) {
|
||||
mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_address);
|
||||
}
|
||||
|
||||
if(mask & ~address_bits) {
|
||||
if (mask & ~address_bits) {
|
||||
mp_raise_ValueError_varg(translate("%q out of range"), MP_QSTR_mask);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
bool specified_size = (size != (size_t)-1);
|
||||
bool specified_data = (args[ARG_data].u_obj != NULL);
|
||||
|
||||
if(specified_size && specified_data) {
|
||||
if (specified_size && specified_data) {
|
||||
mp_raise_TypeError(translate("specify size or data, but not both"));
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
data.len = 0;
|
||||
}
|
||||
|
||||
if(data.len > 8) {
|
||||
if (data.len > 8) {
|
||||
mp_raise_ValueError(translate("Messages limited to 8 bytes"));
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ STATIC mp_obj_t canio_message_data_set(const mp_obj_t self_in, const mp_obj_t da
|
||||
canio_message_obj_t *self = self_in;
|
||||
mp_buffer_info_t data;
|
||||
mp_get_buffer_raise(data_in, &data, MP_BUFFER_READ);
|
||||
if(data.len > 8) {
|
||||
if (data.len > 8) {
|
||||
mp_raise_ValueError(translate("Messages limited to 8 bytes"));
|
||||
}
|
||||
common_hal_canio_message_data_set(self, data.buf, data.len);
|
||||
@ -161,7 +161,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(canio_message_size_get_obj, canio_message_size_get);
|
||||
STATIC mp_obj_t canio_message_size_set(const mp_obj_t self_in, const mp_obj_t size_in) {
|
||||
canio_message_obj_t *self = self_in;
|
||||
int size = mp_obj_get_int(size_in);
|
||||
if(size > 8) {
|
||||
if (size > 8) {
|
||||
mp_raise_ValueError(translate("Messages limited to 8 bytes"));
|
||||
}
|
||||
common_hal_canio_message_size_set(self, size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user