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

_cyw43_write_reg assigns to last_size/_header/_backplane_window variables which are never used #2305

Open
dpgeorge opened this issue Feb 19, 2025 · 4 comments
Assignees
Milestone

Comments

@dpgeorge
Copy link

The cyw43 SPI transport _cyw43_write_reg() function has this bit of code in it:

    if (fn == BACKPLANE_FUNCTION) {
        // In case of f1 overflow
        self->last_size = 8;
        self->last_header[0] = buf[0];
        self->last_header[1] = buf[1];
        self->last_backplane_window = self->cur_backplane_window;
    }

(self is a cyw43 driver instance.)

These last_xxx variables are never used by cyw43-driver because F1_OVERFLOW_CHANGE is permanently disabled. And that feature even has comments that it never actually worked.

It would be good to get rid of these variables in the cyw43 driver data structure, to save a little bit of RAM and clean it up. So I propose removing their use from this sdk.

Alternatively the above code could be guarded by a #if F1_OVERFLOW_CHANGE, but then that config option would need to be made public, probably named CYW43_F1_OVERFLOW_CHANGE.

@peterharperuk
Copy link
Contributor

Yes - we should get rid of all that junk.

@dpgeorge
Copy link
Author

we should get rid of all that junk

Can I just remove all the F1_OVERFLOW_CHANGE code?

@peterharperuk
Copy link
Contributor

Yes please - I meant to raise a PR to remove it - but kept forgetting. It was originally a suggestion from Infineon I believe. I'm not sure it ever actually worked and we managed to fix the issue another way and have never used this code again.

@dpgeorge
Copy link
Author

Yes please - I meant to raise a PR to remove it - but kept forgetting

OK, done in georgerobotics/cyw43-driver#134

@kilograham kilograham added this to the 2.1.2 milestone Feb 20, 2025
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

No branches or pull requests

3 participants