- 29 Oct, 2023 2 commits
-
-
David Lechner authored
This reverts commit a50ff187. The Bluetooth drivers have task queues that prevent more than 1 task from running concurrently. The reverted change broke this safety mechanism by pumping tasks from MicroPython causing multiple tasks to run at the same time, overwhelming the Bluetooth chip.
-
David Lechner authored
We were always reading/writing 3 extra bytes because we weren't taking into account the 3 extra bytes already sent for the header. Also, real_write_xfer_size is unsigned and can be zero, so we should not be subtracting from it. Also, also, add some comments to clarify where the FCS (checksum) byte comes into play.
-
- 28 Oct, 2023 1 commit
-
-
Laurens Valk authored
The Move Hub cannot have true vector axes, but we can still use this API to initialize the hub using numeric indices. This ensures we can use the custom orientation not just in tilt, but also in acceleration like we do on other hubs.
-
- 27 Oct, 2023 2 commits
-
-
Laurens Valk authored
-
Laurens Valk authored
This object does not have an attribute handler, causing any imu read operation to crash the hub. Fixes https://github.com/pybricks/support/issues/1269
-
- 26 Oct, 2023 7 commits
-
-
Laurens Valk authored
-
Laurens Valk authored
-
Laurens Valk authored
Fixes https://github.com/pybricks/support/issues/1162
-
Laurens Valk authored
Fixes https://github.com/pybricks/support/issues/881
-
Laurens Valk authored
Fixes https://github.com/pybricks/support/issues/1151
-
Laurens Valk authored
Previously, tasks were only driven by Bluetooth events so timers would not work correctly.
-
Laurens Valk authored
-
- 24 Oct, 2023 4 commits
-
-
Laurens Valk authored
This is more consistent with the rest of our API where collections are returned.
-
Laurens Valk authored
Since None is used to indicate no data, it is more intuitive avoid it as a data type. This will also allow us implement it such that broadcast(None) stops broadcasting, equivalent to reading None in observe. This is marked as a TODO for future implementation.
-
Laurens Valk authored
This makes it simple to send and receive single values. It is also necessary for an upcoming non-Python implementation.
-
Laurens Valk authored
This ensures the same object is sent and received.
-
- 23 Oct, 2023 7 commits
-
-
Laurens Valk authored
Fixes https://github.com/pybricks/support/issues/1213
-
Laurens Valk authored
This was putting the sensor in the wrong mode. Fixes https://github.com/pybricks/support/issues/1232
-
Laurens Valk authored
This was called before the drivebase could be used, and the error was not returned. Fixes 3ae1fb89 (which was unreleased).
-
Laurens Valk authored
Keep singular for backwards compatibility. Fixes https://github.com/pybricks/support/issues/1254
-
Laurens Valk authored
-
Laurens Valk authored
Also ensure we pick the proper sign for v in radial computations.
-
Laurens Valk authored
With the newly introduced color cost function, any measured value less than 50 results in Color.NONE, which makes it the predominant result. This reduces the distance range for the default colors. Instead of adjusting all colors (which are also used to emit colors), we can make the value of Color.NONE negative to achieve a similar result.
-
- 20 Oct, 2023 4 commits
-
-
Laurens Valk authored
The newly introduced color cost function intrinsically deals with low s and v, so we don't need to artificially suppress them here.
-
Johannes Ringler authored
This new distance function estimates the similarity of two hsv colors by calculating their euclidean distance when mapped into a Hue-Chroma-Lightness bicone. This is much more robust for realistic colors, especially when low saturation or low value is involved.
-
Laurens Valk authored
For color detection applications, negative h can be used to increase the contrast between "no color" and any other color. For most other application, the value has a lower bound of 0, which is what this commit enforces.
-
Laurens Valk authored
-
- 30 Jul, 2023 1 commit
-
-
Laurens Valk authored
Fixes https://github.com/pybricks/support/issues/1189
-
- 13 Jul, 2023 12 commits
-
-
Laurens Valk authored
Since we added the use_gyro() method to turn the gyro on and off, we no longer need a separate GyroDriveBase class.
-
Laurens Valk authored
It was placed in legodev_pup to avoid the need for an extra process. But since it isn't enabled on Move Hub anyway, it makes more sense to place it where it belongs.
-
Laurens Valk authored
-
Laurens Valk authored
-
Laurens Valk authored
-
Laurens Valk authored
This makes the main uart thread cleaner. Instead of resetting one thread with PT_INIT midway from another thread, organize them as follows: - spawn synchronization, exit on error - run send + receive in parallel until no data This in turn can be spawned from the higher level process on platforms that support device detection, or just called indefinitely on platforms where uart mode is always active.
-
Laurens Valk authored
Instead of using numerous goto's, we can return an error like we do everywhere in pbio. In this case bind it to the device for easy access.
-
Laurens Valk authored
There were mixes of port_data, data, and dev for the same types, which were not related to the actual data variables. Things like data->pt where very different from data_pt. All pbdrv_legodev_pup_uart_dev_t are local to this file, so call them ludev for short.
-
Laurens Valk authored
- There were two different variables both named prev_type_id used for different things. - Now uses one child protothread for the dcm and the uart sensor since they run at different times. - Moved where the affirmative ids are kept.
-
Laurens Valk authored
The device connection manager and the uart device driver never need to run at the same time, so drive them from a single process. This reduces complexity and code size, and also reduces the time needed to handle devices disconnecting since there are no longer multiple timeouts to wait on. It also separates the pup_uart code further so it can run on other devices like EV3 which don't have the same connection manager.
-
Laurens Valk authored
This way we know it is initialized when pbdrv_init completes.
-
Laurens Valk authored
This is only used to await tasks that do not have to be cancelled, like setting the remote light. Tasks with cancellation on timeout (like connecting to the remote) remain blocking.
-