diff --git a/html/telemetrix/index.html b/html/telemetrix/index.html
index 3e2dff3..6321047 100644
--- a/html/telemetrix/index.html
+++ b/html/telemetrix/index.html
@@ -302,7 +302,7 @@
Module telemetrix.telemetrix
self.stepper_info_list = []
# a list of dictionaries to hold stepper information
for motor in range(self.max_number_of_steppers):
- self.stepper_info_list.append(self.stepper_info)
+ self.stepper_info_list.append(self.stepper_info.copy())
self.the_reporter_thread.start()
self.the_data_receive_thread.start()
@@ -415,6 +415,10 @@ Module telemetrix.telemetrix
for serial_port in serial_ports:
self.serial_port = serial_port
+ # Since opening the port, there might be e.g., boot logs in the
+ # buffer. Clear them before proceeding.
+ self.serial_port.reset_input_buffer()
+
self._get_arduino_id()
if self.reported_arduino_id != self.arduino_instance_id:
continue
@@ -597,8 +601,9 @@ Module telemetrix.telemetrix
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
+
"""
@@ -636,8 +641,8 @@ Module telemetrix.telemetrix
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
"""
@@ -906,6 +911,10 @@ Module telemetrix.telemetrix
raise RuntimeError('set_pin_mode_dht: A Callback must be specified')
if self.dht_count < PrivateConstants.MAX_DHTS - 1:
+ if pin in self.dht_callbacks.keys():
+ if self.shutdown_on_exception:
+ self.shutdown()
+ raise RuntimeError(f'set_pin_mode_dht Pin {pin} already assigned')
self.dht_callbacks[pin] = callback
self.dht_count += 1
@@ -1004,7 +1013,7 @@ Module telemetrix.telemetrix
"""
if self.reported_features & PrivateConstants.SPI_FEATURE:
- if type(chip_select_list) != list:
+ if type(chip_select_list) is not list:
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError('chip_select_list must be in the form of a list')
@@ -2868,7 +2877,7 @@
self.stepper_info_list = []
# a list of dictionaries to hold stepper information
for motor in range(self.max_number_of_steppers):
- self.stepper_info_list.append(self.stepper_info)
+ self.stepper_info_list.append(self.stepper_info.copy())
self.the_reporter_thread.start()
self.the_data_receive_thread.start()
@@ -2981,6 +2990,10 @@
for serial_port in serial_ports:
self.serial_port = serial_port
+ # Since opening the port, there might be e.g., boot logs in the
+ # buffer. Clear them before proceeding.
+ self.serial_port.reset_input_buffer()
+
self._get_arduino_id()
if self.reported_arduino_id != self.arduino_instance_id:
continue
@@ -3163,8 +3176,9 @@
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
+
"""
@@ -3202,8 +3216,8 @@
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
"""
@@ -3472,6 +3486,10 @@
raise RuntimeError('set_pin_mode_dht: A Callback must be specified')
if self.dht_count < PrivateConstants.MAX_DHTS - 1:
+ if pin in self.dht_callbacks.keys():
+ if self.shutdown_on_exception:
+ self.shutdown()
+ raise RuntimeError(f'set_pin_mode_dht Pin {pin} already assigned')
self.dht_callbacks[pin] = callback
self.dht_count += 1
@@ -3570,7 +3588,7 @@
"""
if self.reported_features & PrivateConstants.SPI_FEATURE:
- if type(chip_select_list) != list:
+ if type(chip_select_list) is not list:
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError('chip_select_list must be in the form of a list')
@@ -5352,8 +5370,8 @@ Methods
before read
Else, the write is suppressed
callback returns a data list:
-[I2C_READ_REPORT, address, register, count of data bytes,
-data bytes, time-stamp]
+[I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+bytes read…, time-stamp]
Expand source code
@@ -5385,8 +5403,9 @@ Methods
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
+
"""
@@ -5413,8 +5432,8 @@ Methods
:param write_register: If True, the register is written before read
Else, the write is suppressed
callback returns a data list:
-[I2C_READ_REPORT, address, register, count of data bytes,
-data bytes, time-stamp]
+[I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+bytes read…, time-stamp]
Expand source code
@@ -5449,8 +5468,8 @@ Methods
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes,
- data bytes, time-stamp]
+ [I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
+ bytes read..., time-stamp]
"""
@@ -6018,6 +6037,10 @@ Methods
raise RuntimeError('set_pin_mode_dht: A Callback must be specified')
if self.dht_count < PrivateConstants.MAX_DHTS - 1:
+ if pin in self.dht_callbacks.keys():
+ if self.shutdown_on_exception:
+ self.shutdown()
+ raise RuntimeError(f'set_pin_mode_dht Pin {pin} already assigned')
self.dht_callbacks[pin] = callback
self.dht_count += 1
@@ -6317,7 +6340,7 @@ Methods
"""
if self.reported_features & PrivateConstants.SPI_FEATURE:
- if type(chip_select_list) != list:
+ if type(chip_select_list) is not list:
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError('chip_select_list must be in the form of a list')