Skip to content

Commit

Permalink
Issue #83 Correct i2c_read comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrYsLab committed May 11, 2024
1 parent 38998ab commit 9d36a00
Showing 1 changed file with 44 additions and 21 deletions.
65 changes: 44 additions & 21 deletions html/telemetrix/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
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()
Expand Down Expand Up @@ -415,6 +415,10 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
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
Expand Down Expand Up @@ -597,8 +601,9 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>

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]


&#34;&#34;&#34;

Expand Down Expand Up @@ -636,8 +641,8 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>

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]

&#34;&#34;&#34;

Expand Down Expand Up @@ -906,6 +911,10 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
raise RuntimeError(&#39;set_pin_mode_dht: A Callback must be specified&#39;)

if self.dht_count &lt; PrivateConstants.MAX_DHTS - 1:
if pin in self.dht_callbacks.keys():
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError(f&#39;set_pin_mode_dht Pin {pin} already assigned&#39;)
self.dht_callbacks[pin] = callback
self.dht_count += 1

Expand Down Expand Up @@ -1004,7 +1013,7 @@ <h1 class="title">Module <code>telemetrix.telemetrix</code></h1>
&#34;&#34;&#34;

if self.reported_features &amp; 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(&#39;chip_select_list must be in the form of a list&#39;)
Expand Down Expand Up @@ -2868,7 +2877,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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()
Expand Down Expand Up @@ -2981,6 +2990,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
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
Expand Down Expand Up @@ -3163,8 +3176,9 @@ <h2 class="section-title" id="header-classes">Classes</h2>

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]


&#34;&#34;&#34;

Expand Down Expand Up @@ -3202,8 +3216,8 @@ <h2 class="section-title" id="header-classes">Classes</h2>

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]

&#34;&#34;&#34;

Expand Down Expand Up @@ -3472,6 +3486,10 @@ <h2 class="section-title" id="header-classes">Classes</h2>
raise RuntimeError(&#39;set_pin_mode_dht: A Callback must be specified&#39;)

if self.dht_count &lt; PrivateConstants.MAX_DHTS - 1:
if pin in self.dht_callbacks.keys():
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError(f&#39;set_pin_mode_dht Pin {pin} already assigned&#39;)
self.dht_callbacks[pin] = callback
self.dht_count += 1

Expand Down Expand Up @@ -3570,7 +3588,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
&#34;&#34;&#34;

if self.reported_features &amp; 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(&#39;chip_select_list must be in the form of a list&#39;)
Expand Down Expand Up @@ -5352,8 +5370,8 @@ <h3>Methods</h3>
before read
Else, the write is suppressed</p>
<p>callback returns a data list:</p>
<p>[I2C_READ_REPORT, address, register, count of data bytes,
data bytes, time-stamp]</p></div>
<p>[I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
bytes read&hellip;, time-stamp]</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
Expand Down Expand Up @@ -5385,8 +5403,9 @@ <h3>Methods</h3>

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]


&#34;&#34;&#34;

Expand All @@ -5413,8 +5432,8 @@ <h3>Methods</h3>
<p>:param write_register: If True, the register is written before read
Else, the write is suppressed</p>
<p>callback returns a data list:</p>
<p>[I2C_READ_REPORT, address, register, count of data bytes,
data bytes, time-stamp]</p></div>
<p>[I2C_READ_REPORT, i2c_port, number of bytes read, address, register,
bytes read&hellip;, time-stamp]</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
Expand Down Expand Up @@ -5449,8 +5468,8 @@ <h3>Methods</h3>

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]

&#34;&#34;&#34;

Expand Down Expand Up @@ -6018,6 +6037,10 @@ <h3>Methods</h3>
raise RuntimeError(&#39;set_pin_mode_dht: A Callback must be specified&#39;)

if self.dht_count &lt; PrivateConstants.MAX_DHTS - 1:
if pin in self.dht_callbacks.keys():
if self.shutdown_on_exception:
self.shutdown()
raise RuntimeError(f&#39;set_pin_mode_dht Pin {pin} already assigned&#39;)
self.dht_callbacks[pin] = callback
self.dht_count += 1

Expand Down Expand Up @@ -6317,7 +6340,7 @@ <h3>Methods</h3>
&#34;&#34;&#34;

if self.reported_features &amp; 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(&#39;chip_select_list must be in the form of a list&#39;)
Expand Down

0 comments on commit 9d36a00

Please sign in to comment.