We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current OutputPort::write() code:
void write(port_data_t value) { atomic { // read-modify-write cycle port_data_t v = port::port_output_read(); port_data_t shifted = value << start_bit; v |= shifted & mask; v &= (shifted | ~mask); port::port_output_write(v); } }
On chips that have an output toggle feature, this can probably be sped up significantly using the clever XOR-based trick that I first saw in the RPi Pico SDK (https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_gpio/include/hardware/gpio.h#L719 )
the new code would not need "atomic", and would look something like:
void write(port_data_t value) { port_data_t v = port::port_output_read(); port_data_t shifted = value << start_bit; v ^= shifted; port::port_output_toggle(v & mask); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current OutputPort::write() code:
On chips that have an output toggle feature, this can probably be sped up significantly using the clever XOR-based trick that I first saw in the RPi Pico SDK (https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/hardware_gpio/include/hardware/gpio.h#L719 )
the new code would not need "atomic", and would look something like:
The text was updated successfully, but these errors were encountered: