Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Remove radio.RATE_250KBIT as it has been dropped from V2. #731

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

microbit-carlos
Copy link
Collaborator

@microbit-carlos microbit-carlos commented Mar 25, 2022

The constant is still present in the micro:bit V1 MicroPython port, but it is not in the V2 MicroPython port.
The value from the constant (2) can be used as an argument in the V2 MicroPython radio.config(data_rate=2), but because it is not officially supported in the V2 nRF52833 microcontroller we cannot guarantee it will always work.

To keep the documentation simple it might be better to remove the mention of radio.RATE_250KBIT, rather than adding more content to a fairly long function description.

Discussion in microbit-foundation/micropython-microbit-v2#87.

@dpgeorge
Copy link
Member

I agree, removing this const from the docs would be a good idea (so it's not used in new code).

But I also think there should be an addition to the docs explaining to some extent the situation with this constant and the 250kb data rate. Eg "A datarate of 250kbit/sec is possible with micro:bit v1, and may be possible with micro:bit v2. To access this hidden feature pass "2" to the data_rate config argument. This was previously accessible via RATE_250KBIT but has been removed because it's not guaranteed to work on all v2 devices."

@microbit-carlos
Copy link
Collaborator Author

Sounds good 👍
I'll add it to the PR.

@microbit-carlos
Copy link
Collaborator Author

As this PR will go into the main branch, which is for the V1 docs I think it might be better to separate this message for each target.

This PR contains the following note in the constants section:

.. note::

    A lower data rate of 250 kbit/sec is possible with micro:bit V1 via
    the ``RATE_250KBIT`` constant (or using its value ``2`` directly). However
    as this rate is not guaranteed to work on V2 it has been deprecated for
    compatibility reasons.

And this note below the data_rate argument in the V2 docs:

    .. note::

        A lower data rate of of 250kbit/sec is supported in micro:bit V1, and
        may be possible with micro:bit V2, but it is not guaranteed to work on
        all devices. To access this hidden feature for compatibility with V1
        pass ``2`` to the ``data_rate`` argument.

@microbit-carlos
Copy link
Collaborator Author

@dpgeorge if the wording looks good we can merge this and create the v2-docs PR after rebasing that branch.

@dpgeorge
Copy link
Member

This looks fine to me.

The constant is still present in the micro:bit V1 MicroPython
port, but it is not in the V2 MicroPython port.
The value from the constant (`2`) can be used as an argument in
the V2 MicroPython `radio.config(data_rate=2)`, but because it is
not officially supported in the V2 nRF52833 microcontroller we
cannot guarantee it will always work, so the constant is
deprecated in V1 and removed in V2.
@microbit-carlos
Copy link
Collaborator Author

Thanks Damien, as discussed in the call, I've changed it back as a constant with a deprecation notice here and will create a different update specifically for the V2 docs.

image

@dpgeorge
Copy link
Member

I've changed it back as a constant with a deprecation notice

Very good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants