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

SDWire: only takes milliseconds to change #60

Open
perezmeyer opened this issue Sep 5, 2023 · 3 comments · May be fixed by #61
Open

SDWire: only takes milliseconds to change #60

perezmeyer opened this issue Sep 5, 2023 · 3 comments · May be fixed by #61

Comments

@perezmeyer
Copy link
Contributor

Currently the code reads:

    async toggleMux(state: string): Promise<void> {
        if(state === 'host'){
            console.log('Switching SD card to host');
            await execAsync('sd-mux-ctrl --ts -v 0');
            // it can take some time before the mux is toggled - so just to be sure, we can add some delay here
            await delay(5000);
        } else if(state === 'dut'){
            console.log('Switching SD card to DUT');
            await execAsync('sd-mux-ctrl --dut -v 0');
            // it can take some time before the mux is toggled - so just to be sure, we can add some delay here
            await delay(5000);
        }
    }

SDWire takes just a few milliseconds to switch. If the delay is expressed in milliseconds I would say reduce that to 500.

@perezmeyer
Copy link
Contributor Author

@rcooke-warwick @vipulgupta2048 Seems I can not assign issues, so pinging you here.

perezmeyer added a commit to perezmeyer/autokit-interface-sw that referenced this issue Sep 5, 2023
Might be even less, but for sure this is better than 5 seconds.

Closes: balena-io-hardware#60

Change-type: patch
Signed-off-by: Lisandro Pérez Meyer <[email protected]>
@perezmeyer perezmeyer linked a pull request Sep 5, 2023 that will close this issue
vipulgupta2048 pushed a commit to perezmeyer/autokit-interface-sw that referenced this issue Sep 5, 2023
Might be even less, but for sure this is better than 5 seconds.

Closes: balena-io-hardware#60

Change-type: patch
Signed-off-by: Lisandro Pérez Meyer <[email protected]>
vipulgupta2048 pushed a commit to perezmeyer/autokit-interface-sw that referenced this issue Sep 5, 2023
Might be even less, but for sure this is better than 5 seconds.

Closes: balena-io-hardware#60

Change-type: patch
Signed-off-by: Lisandro Pérez Meyer <[email protected]>
perezmeyer added a commit to perezmeyer/autokit-interface-sw that referenced this issue Sep 6, 2023
Might be even less, but for sure this is better than 5 seconds.

Closes: balena-io-hardware#60

Change-type: patch
Signed-off-by: Lisandro Pérez Meyer <[email protected]>
@rcooke-warwick
Copy link
Collaborator

hey @vipulgupta2048 @perezmeyer , here's my opinion on this change:

  • I agree that 5000ms/5s is too long of a delay, and we could reduce it
  • I think that reducing it to half a second may be too short. I'm sure the MUX itself does toggle much faster than that, but before, when these command line commands have been wrapped in node subprocesses as they are here, I've seen pretty inconsistant behaviour
  • To put things into perspective, the test suite in full takes over an hour on the faster device types. This optimisation that saves 10 seconds, is a negligable improvement to that time - but if reducing the delay to so "small" an amount introduces unpredictable behaviour some of the time, it may not be worth it.

@perezmeyer
Copy link
Contributor Author

Well, that sounds like a bug in node code... but OK, I'll increase it to 1s

perezmeyer added a commit to perezmeyer/autokit-interface-sw that referenced this issue Sep 12, 2023
Might be even less, but for sure this is better than 5 seconds.

Closes: balena-io-hardware#60

Change-type: patch
Signed-off-by: Lisandro Pérez Meyer <[email protected]>
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 a pull request may close this issue.

2 participants